tools/pvscan.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tools/pvscan.c b/tools/pvscan.c index d9ad097..47ad0f1 100644 --- a/tools/pvscan.c +++ b/tools/pvscan.c @@ -18,6 +18,8 @@ #include "lvmetad.h" #include "lvmcache.h" +extern int use_full_md_check; + struct pvscan_params { int new_pvs_found; int pvs_found; @@ -302,6 +304,7 @@ static int _pvscan_cache(struct cmd_context *cmd, int argc, char **argv) struct dm_list found_vgnames; struct device *dev; struct device_list *devl; + struct dev_iter *iter; const char *pv_name; const char *reason = NULL; int32_t major = -1; @@ -443,6 +446,22 @@ static int _pvscan_cache(struct cmd_context *cmd, int argc, char **argv) /* Creates a list of dev names from /dev, sysfs, etc; does not read any. */ dev_cache_scan(); + /* See the same check in label_scan() to handle md 0.9/1.0 components. */ + if (!(iter = dev_iter_create(cmd->full_filter, 0))) { + log_error("Scanning failed to get devices."); + return 0; + } + while ((dev = dev_iter_get(iter))) { + if (dev_is_md_with_end_superblock(cmd->dev_types, dev)) { + cmd->use_full_md_check = 1; + use_full_md_check = 1; + log_debug("Found md with end superblock %s", dev_name(dev)); + } + } + dev_iter_destroy(iter); + if (!use_full_md_check) + log_debug("No md devs with end superblock"); + dm_list_init(&single_devs); while (argc--) {