blockdev-util: partition block devices never have partition scanning enabled
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user