]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
blockdev-util: update comment for blockdev_partscan_enabled
authorMike Yuan <me@yhndnzj.com>
Thu, 30 May 2024 07:26:44 +0000 (15:26 +0800)
committerLuca Boccassi <luca.boccassi@gmail.com>
Thu, 30 May 2024 08:57:30 +0000 (10:57 +0200)
Follow-up for aa6fe772e1886cdf759954bc2a4742e818ec84c5

Also, the 'partscan' sysattr has been backported to v6.6.

src/shared/blockdev-util.c

index 592257a0387cb38162566189d3e4dd46aaf109ca..2055550336f6aa89e390e926bd73b1a399930013 100644 (file)
@@ -398,14 +398,15 @@ int blockdev_partscan_enabled(int fd) {
          * the 'capability' sysfs attribute is deprecated, hence we cannot check flags from it. ðŸ’£ðŸ’£ðŸ’£
          *
          * With https://github.com/torvalds/linux/commit/a4217c6740dc64a3eb6815868a9260825e8c68c6 (v6.10,
-         * backported to v6.9), the partscan status is directly exposed as 'partscan' sysattr.
+         * backported to v6.6+), the partscan status is directly exposed as 'partscan' sysattr.
          *
          * To support both old and new kernels, we need to do the following:
          * 1) check 'partscan' sysfs attribute where the information is made directly available,
-         * 2) check 'loop/partscan' sysfs attribute for loopback block devices, and if '0' we can conclude
+         * 2) check if the blockdev refers to a partition, where partscan is not supported,
+         * 3) check 'loop/partscan' sysfs attribute for loopback block devices, and if '0' we can conclude
          *    partition scanning is disabled,
-         * 3) check 'ext_range' sysfs attribute, and if '1' we can conclude partition scanning is disabled,
-         * 4) otherwise check 'capability' sysfs attribute for ancient version. */
+         * 4) check 'ext_range' sysfs attribute, and if '1' we can conclude partition scanning is disabled,
+         * 5) otherwise check 'capability' sysfs attribute for ancient version. */
 
         assert(fd >= 0);