mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +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;
|
||||
/* Create a dummy instance. */
|
||||
struct format_instance_ctx fic = { .type = 0 };
|
||||
uint32_t ext_version;
|
||||
uint32_t ext_flags;
|
||||
int ret = 0;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
baton.cmd = cmd;
|
||||
|
Loading…
Reference in New Issue
Block a user