mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-04 09:18:36 +03:00
pvscan: ignore online for unused PV
If an unused PV comes online, ignore it from pvscan --cache.
This commit is contained in:
parent
07483cc165
commit
a0c848d4e4
@ -644,6 +644,8 @@ static int _online_pvscan_one(struct cmd_context *cmd, struct device *dev,
|
|||||||
const struct format_type *fmt;
|
const struct format_type *fmt;
|
||||||
/* Create a dummy instance. */
|
/* Create a dummy instance. */
|
||||||
struct format_instance_ctx fic = { .type = 0 };
|
struct format_instance_ctx fic = { .type = 0 };
|
||||||
|
uint32_t ext_version;
|
||||||
|
uint32_t ext_flags;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
log_debug("pvscan metadata from dev %s", dev_name(dev));
|
log_debug("pvscan metadata from dev %s", dev_name(dev));
|
||||||
@ -667,6 +669,14 @@ static int _online_pvscan_one(struct cmd_context *cmd, struct device *dev,
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ext_version = lvmcache_ext_version(info);
|
||||||
|
ext_flags = lvmcache_ext_flags(info);
|
||||||
|
|
||||||
|
if ((ext_version >= 2) && !(ext_flags & PV_EXT_USED)) {
|
||||||
|
log_print("pvscan[%d] PV %s not used.", getpid(), dev_name(dev));
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
fmt = lvmcache_fmt(info);
|
fmt = lvmcache_fmt(info);
|
||||||
|
|
||||||
baton.cmd = cmd;
|
baton.cmd = cmd;
|
||||||
|
Loading…
Reference in New Issue
Block a user