Skip to content

Commit

Permalink
zdb: fix printf() length for uint64_t devid
Browse files Browse the repository at this point in the history
Bug introduced in 213d682.

Reviewed-by: Alexander Motin <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Warner Losh <[email protected]>
Signed-off-by: Martin Matuska <[email protected]>
Closes #15606
  • Loading branch information
mmatuska authored and tonyhutter committed Nov 29, 2023
1 parent d813aa8 commit eb34de0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/zdb/zdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -2126,14 +2126,14 @@ dump_brt(spa_t *spa)
continue;

if (!brtvd->bv_initiated) {
printf("BRT: vdev %lu: empty\n", vdevid);
printf("BRT: vdev %" PRIu64 ": empty\n", vdevid);
continue;
}

zdb_nicenum(brtvd->bv_totalcount, count, sizeof (count));
zdb_nicebytes(brtvd->bv_usedspace, used, sizeof (used));
zdb_nicebytes(brtvd->bv_savedspace, saved, sizeof (saved));
printf("BRT: vdev %lu: refcnt %s; used %s; saved %s\n",
printf("BRT: vdev %" PRIu64 ": refcnt %s; used %s; saved %s\n",
vdevid, count, used, saved);
}

Expand All @@ -2156,7 +2156,7 @@ dump_brt(spa_t *spa)
uint64_t offset = *(uint64_t *)za.za_name;
uint64_t refcnt = za.za_first_integer;

snprintf(dva, sizeof (dva), "%lu:%llx", vdevid,
snprintf(dva, sizeof (dva), "%" PRIu64 ":%llx", vdevid,
(u_longlong_t)offset);
printf("%-16s %-10llu\n", dva, (u_longlong_t)refcnt);
}
Expand Down

0 comments on commit eb34de0

Please sign in to comment.