diff options
author | Karel Zak | 2011-08-02 13:28:04 +0200 |
---|---|---|
committer | Karel Zak | 2011-08-02 13:28:04 +0200 |
commit | 538a2fe950fb534ba0db4cca144c01f58815e498 (patch) | |
tree | d7f25be54d7b8cc263254dbb3b47a396fed1305c /libblkid/src/superblocks/zfs.c | |
parent | libblkid: [partitions] fix compiler warnings [-Wunused-parameter -Wsign-compare] (diff) | |
download | kernel-qcow2-util-linux-538a2fe950fb534ba0db4cca144c01f58815e498.tar.gz kernel-qcow2-util-linux-538a2fe950fb534ba0db4cca144c01f58815e498.tar.xz kernel-qcow2-util-linux-538a2fe950fb534ba0db4cca144c01f58815e498.zip |
libblkid: [superblocks] fix compiler warnings [-Wunused-parameter -Wsign-compare]
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libblkid/src/superblocks/zfs.c')
-rw-r--r-- | libblkid/src/superblocks/zfs.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/libblkid/src/superblocks/zfs.c b/libblkid/src/superblocks/zfs.c index af5264d46..b96c5df45 100644 --- a/libblkid/src/superblocks/zfs.c +++ b/libblkid/src/superblocks/zfs.c @@ -70,7 +70,7 @@ static void zfs_extract_guid_name(blkid_probe pr, loff_t offset) { struct nvlist *nvl; struct nvpair *nvp; - int left = 4096; + size_t left = 4096; int found = 0; offset = (offset & ~(VDEV_LABEL_SIZE - 1)) + VDEV_LABEL_NVPAIR; @@ -94,7 +94,7 @@ static void zfs_extract_guid_name(blkid_probe pr, loff_t offset) nvp->nvp_namelen = be32_to_cpu(nvp->nvp_namelen); avail = nvp->nvp_size - nvp->nvp_namelen - sizeof(*nvp); - nvdebug("left %u, nvp_size %u\n", left, nvp->nvp_size); + nvdebug("left %zd nvp_size %u\n", left, nvp->nvp_size); if (left < nvp->nvp_size || avail < 0) break; @@ -148,7 +148,10 @@ static void zfs_extract_guid_name(blkid_probe pr, loff_t offset) "%"PRIu64, nvu_value); found++; } - left -= nvp->nvp_size; + if (left > nvp->nvp_size) + left -= nvp->nvp_size; + else + left = 0; nvp = (struct nvpair *)((char *)nvp + nvp->nvp_size); } } @@ -159,7 +162,8 @@ static void zfs_extract_guid_name(blkid_probe pr, loff_t offset) /* ZFS has 128x1kB host-endian root blocks, stored in 2 areas at the start * of the disk, and 2 areas at the end of the disk. Check only some of them... * #4 (@ 132kB) is the first one written on a new filesystem. */ -static int probe_zfs(blkid_probe pr, const struct blkid_idmag *mag) +static int probe_zfs(blkid_probe pr, + const struct blkid_idmag *mag __attribute__((__unused__))) { uint64_t swab_magic = swab64(UBERBLOCK_MAGIC); struct zfs_uberblock *ub; |