From: Karel Zak Date: Mon, 13 Jan 2020 12:00:14 +0000 (+0100) Subject: libblkid: (zfs) don't probe whole-disk areas covered by partitions X-Git-Tag: v2.35~22 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f6e182078a3f05af3ce3b5e5a2d1956d4b9677e2;p=thirdparty%2Futil-linux.git libblkid: (zfs) don't probe whole-disk areas covered by partitions Addresses: https://github.com/karelzak/util-linux/issues/918 Signed-off-by: Karel Zak --- diff --git a/libblkid/src/superblocks/zfs.c b/libblkid/src/superblocks/zfs.c index e0c544917d..774a199e1b 100644 --- a/libblkid/src/superblocks/zfs.c +++ b/libblkid/src/superblocks/zfs.c @@ -278,6 +278,12 @@ static int probe_zfs(blkid_probe pr, break; } + if ((S_ISREG(pr->mode) || blkid_probe_is_wholedisk(pr)) && + blkid_probe_is_covered_by_pt(pr, offset, VDEV_LABEL_SIZE)) + /* ignore this area, it's within any partition and + * we are working with whole-disk now */ + continue; + label = blkid_probe_get_buffer(pr, offset, VDEV_LABEL_SIZE); if (label == NULL) return errno ? -errno : 1;