summaryrefslogtreecommitdiffstats
path: root/lib/label/label.c
diff options
context:
space:
mode:
authorAlasdair Kergon <agk@redhat.com>2005-03-21 22:40:35 +0000
committerAlasdair Kergon <agk@redhat.com>2005-03-21 22:40:35 +0000
commite5b836d2d6fff26ea1589482ef0982e99227c98d (patch)
treef97b4ec656fd63e05d61f696568739aa24024f0b /lib/label/label.c
parent162d85b97bf5528720ce711f0e2a26d6f122eca7 (diff)
downloadlvm2-e5b836d2d6fff26ea1589482ef0982e99227c98d.tar.gz
lvm2-e5b836d2d6fff26ea1589482ef0982e99227c98d.tar.xz
lvm2-e5b836d2d6fff26ea1589482ef0982e99227c98d.zip
Improve detection of external changes affecting internal cache.
Diffstat (limited to 'lib/label/label.c')
-rw-r--r--lib/label/label.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/label/label.c b/lib/label/label.c
index 9d6dd685..beda8e97 100644
--- a/lib/label/label.c
+++ b/lib/label/label.c
@@ -117,12 +117,17 @@ static struct labeller *_find_labeller(struct device *dev, char *buf,
struct labeller_i *li;
struct labeller *r = NULL;
struct label_header *lh;
+ struct lvmcache_info *info;
uint64_t sector;
int found = 0;
char readbuf[LABEL_SCAN_SIZE];
if (!dev_open(dev)) {
stack;
+
+ if ((info = info_from_pvid(dev->pvid)))
+ lvmcache_update_vgname(info, ORPHAN);
+
return NULL;
}
@@ -182,10 +187,13 @@ static struct labeller *_find_labeller(struct device *dev, char *buf,
}
}
- if (!found)
+ out:
+ if (!found) {
+ if ((info = info_from_pvid(dev->pvid)))
+ lvmcache_update_vgname(info, ORPHAN);
log_very_verbose("%s: No label detected", dev_name(dev));
+ }
- out:
if (!dev_close(dev))
stack;