]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libblkid: (lvm2) read complete superblock
authorThomas Weißschuh <thomas@t-8ch.de>
Sun, 1 Oct 2023 09:48:01 +0000 (11:48 +0200)
committerThomas Weißschuh <thomas@t-8ch.de>
Sun, 1 Oct 2023 12:02:34 +0000 (14:02 +0200)
The lvm2_calc_crc() will create a checksum over LVM2_LABEL_SIZE bytes,
which all need to be read.

Currently this works because the superblock is cached by
blkid_probe_get_idmag() which always reads 1024 bytes.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
libblkid/src/superblocks/lvm.c

index 71ca132021f649a7ccf4e97c6a44213ea292d4de..fdd9cd6d7af9664c2043897885ceedee8f018c11 100644 (file)
@@ -80,7 +80,7 @@ static int probe_lvm2(blkid_probe pr, const struct blkid_idmag *mag)
 
        buf = blkid_probe_get_buffer(pr,
                        mag->kboff << 10,
-                       512 + sizeof(struct lvm2_pv_label_header));
+                       512 + LVM2_LABEL_SIZE);
        if (!buf)
                return errno ? -errno : 1;