From: Lennart Poettering Date: Tue, 28 May 2024 08:01:10 +0000 (+0200) Subject: blockdev-util: partition block devices never have partition scanning enabled X-Git-Tag: v256-rc4~99^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fa6591762343a250bc4f614f92dbfffbbcc3a043;p=thirdparty%2Fsystemd.git blockdev-util: partition block devices never have partition scanning enabled --- diff --git a/src/shared/blockdev-util.c b/src/shared/blockdev-util.c index 322e5280cdf..592257a0387 100644 --- a/src/shared/blockdev-util.c +++ b/src/shared/blockdev-util.c @@ -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)