Skip to content

Commit ea37c30

Browse files
authored
zdb: Fix asize overflow in verify_livelist_allocs()
Spacemap entry might be too big to fit into a block pointer ashift. We hit an assertion trying to run `zdb -bvy` on a large pool. But it seems the code does not really need size there, since we only need to search for a range of offsets, so setting it to zero should just make btree return position just before the first entry. I suspect the previous code could actually miss the first entry due to this if its size was smaller. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Igor Kozhukhov <[email protected]> Signed-off-by: Alexander Motin <[email protected]> Closes #17764
1 parent 876f705 commit ea37c30

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cmd/zdb/zdb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ verify_livelist_allocs(metaslab_verify_t *mv, uint64_t txg,
385385
sublivelist_verify_block_t svb = {{{0}}};
386386
DVA_SET_VDEV(&svb.svb_dva, mv->mv_vdid);
387387
DVA_SET_OFFSET(&svb.svb_dva, offset);
388-
DVA_SET_ASIZE(&svb.svb_dva, size);
388+
DVA_SET_ASIZE(&svb.svb_dva, 0);
389389
zfs_btree_index_t where;
390390
uint64_t end_offset = offset + size;
391391

0 commit comments

Comments
 (0)