]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libblkid: fix regression in setting BLOCK_SIZE value
authorMilan Broz <gmazyland@gmail.com>
Sat, 5 Nov 2022 09:17:48 +0000 (10:17 +0100)
committerMilan Broz <gmazyland@gmail.com>
Sat, 5 Nov 2022 09:24:03 +0000 (10:24 +0100)
In the stable version, the BLOCK_SIZE attribute is
unconditionally set when probing the device.

Commit c9b2297eb1f357d9bc9989aacc874f218081fcb8 added
a new FSINFO flag and conditionally set the BLOCK_SIZE
attribute only when it is used.

This breaks the ABI interface. Cryptsetup reencrypt code
depends on checking the minimal accessible FS block
to prevent the destruction of the filesystem if a user
requests reencryption to a larger sector than
the filesystem can handle.

This patch removes the condition to make ABI compatible
again (as we cannot add FSINFO bit retrospectively).

Signed-off-by: Milan Broz <gmazyland@gmail.com>
libblkid/src/superblocks/superblocks.c

index 9f192edbc3e81f1bf5a3587a1a77d3cae57b6a2b..18fba650a8a86df104eaa47b97d0be71d9b90820 100644 (file)
@@ -564,11 +564,6 @@ int blkid_probe_sprintf_version(blkid_probe pr, const char *fmt, ...)
 
 int blkid_probe_set_block_size(blkid_probe pr, unsigned block_size)
 {
-       struct blkid_chain *chn = blkid_probe_get_chain(pr);
-
-       if (!(chn->flags & BLKID_SUBLKS_FSINFO))
-               return 0;
-
        return blkid_probe_sprintf_value(pr, "BLOCK_SIZE", "%u", block_size);
 }