blockdev-util: partition block devices never have partition scanning enabled

This commit is contained in:
Lennart Poettering
2024-05-28 11:08:06 +02:00
parent 36c5035f2a
commit fa65917623
+5
View File
@@ -418,6 +418,11 @@ int blockdev_partscan_enabled(int fd) {
if (r != -ENOENT)
return r;
/* Partition block devices never have partition scanning on, there's no concept of sub-partitions for
* partitions. */
if (device_is_devtype(dev, "partition"))
return false;
/* For loopback block device, especially for v5.19 or newer. Even if this is enabled, we also need to
* check GENHD_FL_NO_PART flag through 'ext_range' and 'capability' sysfs attributes below. */
if (device_get_sysattr_bool(dev, "loop/partscan") == 0)