From: Mike Yuan Date: Thu, 30 May 2024 07:26:44 +0000 (+0800) Subject: blockdev-util: update comment for blockdev_partscan_enabled X-Git-Tag: v256-rc4~86 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a6117106e4d7632d76a8143958648bfe50ed8c12;p=thirdparty%2Fsystemd.git blockdev-util: update comment for blockdev_partscan_enabled Follow-up for aa6fe772e1886cdf759954bc2a4742e818ec84c5 Also, the 'partscan' sysattr has been backported to v6.6. --- diff --git a/src/shared/blockdev-util.c b/src/shared/blockdev-util.c index 592257a0387..2055550336f 100644 --- a/src/shared/blockdev-util.c +++ b/src/shared/blockdev-util.c @@ -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);