]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
blockdev-util: partition block devices never have partition scanning enabled
authorLennart Poettering <lennart@poettering.net>
Tue, 28 May 2024 08:01:10 +0000 (10:01 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 28 May 2024 09:08:06 +0000 (11:08 +0200)
src/shared/blockdev-util.c

index 322e5280cdf5baf92aa8eb6617f5075a9f8d6d98..592257a0387cb38162566189d3e4dd46aaf109ca 100644 (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)