]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libblkid: (probe) Account for IO bias when retrieving buffer from parent
authorThomas Weißschuh <thomas@t-8ch.de>
Sun, 1 Mar 2026 11:10:39 +0000 (12:10 +0100)
committerThomas Weißschuh <thomas@t-8ch.de>
Sun, 1 Mar 2026 11:13:05 +0000 (12:13 +0100)
The 'off' variable gets aligned to 'pr->io_size'. However when
delegating to the parent prober, the value for 'off' from the original
function parameter needs to be used.

Undo the bias before calling into the parent prober.

Fixes: 8a534253bc52 ("libblkid: (probe) read data in chunks")
Closes: https://github.com/util-linux/util-linux/issues/4078
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
libblkid/src/probe.c

index a38f5990ebe89b432bfbe2a3932d3597661eca2e..60af2915c0d76e2d5911b8b5ca730f27d2e0d909 100644 (file)
@@ -770,7 +770,7 @@ const unsigned char *blkid_probe_get_buffer(blkid_probe pr, uint64_t off, uint64
                 * begin of the device.
                 */
                return blkid_probe_get_buffer(pr->parent,
-                               pr->off + off - pr->parent->off, len);
+                               pr->off + off + bias - pr->parent->off, len);
        }
 
        /* try buffers we already have in memory or read from device */