From fa6591762343a250bc4f614f92dbfffbbcc3a043 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 28 May 2024 10:01:10 +0200 Subject: [PATCH] blockdev-util: partition block devices never have partition scanning enabled --- src/shared/blockdev-util.c | 5 +++++ 1 file changed, 5 insertions(+) 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) -- 2.47.3