]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libblkid: (zfs) don't probe whole-disk areas covered by partitions
authorKarel Zak <kzak@redhat.com>
Mon, 13 Jan 2020 12:00:14 +0000 (13:00 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 13 Jan 2020 12:00:14 +0000 (13:00 +0100)
Addresses: https://github.com/karelzak/util-linux/issues/918
Signed-off-by: Karel Zak <kzak@redhat.com>
libblkid/src/superblocks/zfs.c

index e0c544917d8cccbdf8301717e0671ecb88013312..774a199e1b51e57034af74579391a9c8d03cdd31 100644 (file)
@@ -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;