]> git.ipfire.org Git - thirdparty/systemd.git/commit
repart: return 1 from probe_sector_size_prefer_ioctl() on block device success
authorNandakumar Raghavan <naraghavan@microsoft.com>
Thu, 19 Feb 2026 13:42:19 +0000 (13:42 +0000)
committerLennart Poettering <lennart@poettering.net>
Thu, 19 Feb 2026 16:43:56 +0000 (17:43 +0100)
commitfd6506eb9a39ab2f7cfc7aed6532d8f80a504c44
tree90fdde6ab98b3ed6f3d9705efb733c099a8484ac
parent551227e3a0f0c74b7b857b4e89fe35558808107e
repart: return 1 from probe_sector_size_prefer_ioctl() on block device success

probe_sector_size() returns 1 when it successfully determines the sector size,
0 when falling back to the default. blockdev_get_sector_size() returns 0 on
success. probe_sector_size_prefer_ioctl() was passing blockdev_get_sector_size()
return value through directly, so caller is checking r > 0 to detect a
successfully probed sector size never saw it for block devices.

In context_load_partition_table(), this caused fs_secsz to stay at 4096 bytes
even on 512-byte sector block devices, making verity hash partition sizes wrong
unless --sector-size=512 was passed explicitly.

Fix by returning 1 on success from the block device path to match probe_sector_size()
convention.
src/shared/dissect-image.c