if (!full) {
if (!ret || (ret == -EAGAIN)) {
if (udev_dev_is_md_component(dev))
- return 1;
+ ret = 1;
}
}
+ if (ret && (ret != -EAGAIN))
+ dev->flags |= DEV_IS_MD_COMPONENT;
return ret;
}
- if (dev->ext.src == DEV_EXT_UDEV)
- return _udev_dev_is_md_component(dev);
+ if (dev->ext.src == DEV_EXT_UDEV) {
+ ret = _udev_dev_is_md_component(dev);
+ if (ret && (ret != -EAGAIN))
+ dev->flags |= DEV_IS_MD_COMPONENT;
+ return ret;
+ }
log_error(INTERNAL_ERROR "Missing hook for MD device recognition "
"using external device info source %s", dev_ext_name(dev));
if (value && !strcmp(value, DEV_EXT_UDEV_BLKID_TYPE_SW_RAID)) {
log_debug("Device %s is md raid component based on blkid variable in udev db (%s=\"%s\").",
dev_name(dev), DEV_EXT_UDEV_BLKID_TYPE, value);
+ dev->flags |= DEV_IS_MD_COMPONENT;
ret = 1;
goto out;
}
#define DEV_FILTER_OUT_SCAN 0x00004000 /* filtered out during label scan */
#define DEV_BCACHE_WRITE 0x00008000 /* bcache_fd is open with RDWR */
#define DEV_SCAN_FOUND_LABEL 0x00010000 /* label scan read dev and found label */
+#define DEV_IS_MD_COMPONENT 0x00020000 /* device is an md component */
/*
* Support for external device info.
if (!(dev->flags & DEV_SCAN_FOUND_LABEL))
continue;
+ if (dev->flags & DEV_IS_MD_COMPONENT) {
+ log_debug("exclude md component from hints %s", dev_name(dev));
+ continue;
+ }
+
/*
* No vgname will be found here for a PV with no mdas,
* in which case the vgname hint will be incomplete.