From f6e182078a3f05af3ce3b5e5a2d1956d4b9677e2 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 13 Jan 2020 13:00:14 +0100 Subject: [PATCH] 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 --- libblkid/src/superblocks/zfs.c | 6 ++++++ 1 file changed, 6 insertions(+) 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; -- 2.39.2