|
|
26e710 |
tools/pvscan.c | 40 ++++++++++------------------------------
|
|
|
26e710 |
1 file changed, 10 insertions(+), 30 deletions(-)
|
|
|
26e710 |
|
|
|
26e710 |
diff --git a/tools/pvscan.c b/tools/pvscan.c
|
|
|
26e710 |
index d41345f..db813ad 100644
|
|
|
26e710 |
--- a/tools/pvscan.c
|
|
|
26e710 |
+++ b/tools/pvscan.c
|
|
|
26e710 |
@@ -621,6 +621,16 @@ static int _online_pvscan_one(struct cmd_context *cmd, struct device *dev,
|
|
|
26e710 |
set_pv_devices(baton.fid, baton.vg);
|
|
|
26e710 |
}
|
|
|
26e710 |
|
|
|
26e710 |
+ /* This check repeated because set_pv_devices can do new md check. */
|
|
|
26e710 |
+ if (dev->flags & DEV_IS_MD_COMPONENT) {
|
|
|
26e710 |
+ log_print("pvscan[%d] PV %s ignore MD component, ignore metadata.", getpid(), dev_name(dev));
|
|
|
26e710 |
+ if (baton.vg)
|
|
|
26e710 |
+ release_vg(baton.vg);
|
|
|
26e710 |
+ else
|
|
|
26e710 |
+ fmt->ops->destroy_instance(baton.fid);
|
|
|
26e710 |
+ return 1;
|
|
|
26e710 |
+ }
|
|
|
26e710 |
+
|
|
|
26e710 |
if (baton.vg && vg_is_shared(baton.vg)) {
|
|
|
26e710 |
log_print("pvscan[%d] PV %s ignore shared VG.", getpid(), dev_name(dev));
|
|
|
26e710 |
release_vg(baton.vg);
|
|
|
26e710 |
@@ -638,36 +648,6 @@ static int _online_pvscan_one(struct cmd_context *cmd, struct device *dev,
|
|
|
26e710 |
return 1;
|
|
|
26e710 |
}
|
|
|
26e710 |
|
|
|
26e710 |
- /*
|
|
|
26e710 |
- * Do not consider a device online (for purposes of autoactivation)
|
|
|
26e710 |
- * if its size does not match the PV size recorded in the metadata.
|
|
|
26e710 |
- * It may mean that it's not the correct dev for the PV, e.g. it
|
|
|
26e710 |
- * could be an md component device that's not been filtered.
|
|
|
26e710 |
- */
|
|
|
26e710 |
- if (baton.vg && cmd->check_pv_dev_sizes) {
|
|
|
26e710 |
- struct pv_list *pvl;
|
|
|
26e710 |
- uint64_t dev_size = 0;
|
|
|
26e710 |
- uint64_t meta_pv_size = 0;
|
|
|
26e710 |
-
|
|
|
26e710 |
- dm_list_iterate_items(pvl, &baton.vg->pvs) {
|
|
|
26e710 |
- if (pvl->pv->dev != dev)
|
|
|
26e710 |
- continue;
|
|
|
26e710 |
-
|
|
|
26e710 |
- if (!dev_get_size(dev, &dev_size))
|
|
|
26e710 |
- stack;
|
|
|
26e710 |
- meta_pv_size = pv_size(pvl->pv);
|
|
|
26e710 |
- break;
|
|
|
26e710 |
- }
|
|
|
26e710 |
-
|
|
|
26e710 |
- if (dev_size != meta_pv_size) {
|
|
|
26e710 |
- log_print("pvscan[%d] PV %s ignore for size %llu not matching device %llu.",
|
|
|
26e710 |
- getpid(), dev_name(dev),
|
|
|
26e710 |
- (unsigned long long)meta_pv_size, (unsigned long long)dev_size);
|
|
|
26e710 |
- release_vg(baton.vg);
|
|
|
26e710 |
- return 1;
|
|
|
26e710 |
- }
|
|
|
26e710 |
- }
|
|
|
26e710 |
-
|
|
|
26e710 |
ret = _online_pv_found(cmd, dev, dev_args, baton.vg, found_vgnames);
|
|
|
26e710 |
|
|
|
26e710 |
/*
|