From: Thomas Weißschuh Date: Sun, 1 Oct 2023 09:48:01 +0000 (+0200) Subject: libblkid: (lvm2) read complete superblock X-Git-Tag: v2.40-rc1~220^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c4dad3d846bb715dbf0fb177ae3ca196139eb60e;p=thirdparty%2Futil-linux.git libblkid: (lvm2) read complete superblock 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 --- diff --git a/libblkid/src/superblocks/lvm.c b/libblkid/src/superblocks/lvm.c index 71ca132021..fdd9cd6d7a 100644 --- a/libblkid/src/superblocks/lvm.c +++ b/libblkid/src/superblocks/lvm.c @@ -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;