diff options
Diffstat (limited to 'lib/device')
-rw-r--r-- | lib/device/device.h | 1 | ||||
-rw-r--r-- | lib/device/device_id.c | 14 |
2 files changed, 15 insertions, 0 deletions
diff --git a/lib/device/device.h b/lib/device/device.h index 9e471a9b5..8c3a8c30e 100644 --- a/lib/device/device.h +++ b/lib/device/device.h @@ -40,6 +40,7 @@ #define DEV_IS_NVME 0x00040000 /* set if dev is nvme */ #define DEV_MATCHED_USE_ID 0x00080000 /* matched an entry from cmd->use_devices */ #define DEV_SCAN_FOUND_NOLABEL 0x00100000 /* label_scan read, passed filters, but no lvm label */ +#define DEV_SCAN_NOT_READ 0x00200000 /* label_scan not able to read dev */ /* * Support for external device info. diff --git a/lib/device/device_id.c b/lib/device/device_id.c index 4618247ba..003f10a96 100644 --- a/lib/device/device_id.c +++ b/lib/device/device_id.c @@ -1747,6 +1747,13 @@ void device_ids_validate(struct cmd_context *cmd, struct dm_list *scanned_devs, continue; /* + * The matched device could not be read so we do not have + * the PVID from disk and cannot verify the devices file entry. + */ + if (dev->flags & DEV_SCAN_NOT_READ) + continue; + + /* * du and dev may have been matched, but the dev could still * have been excluded by other filters during label scan. * This shouldn't generally happen, but if it does the user @@ -1828,6 +1835,13 @@ void device_ids_validate(struct cmd_context *cmd, struct dm_list *scanned_devs, if (scanned_devs && !dev_in_device_list(dev, scanned_devs)) continue; + /* + * The matched device could not be read so we do not have + * the PVID from disk and cannot verify the devices file entry. + */ + if (dev->flags & DEV_SCAN_NOT_READ) + continue; + if (!cmd->filter->passes_filter(cmd, cmd->filter, dev, "persistent")) { log_warn("Devices file %s is excluded by filter: %s.", dev_name(dev), dev_filtered_reason(dev)); |