diff --git a/cmd/zdb/zdb.c b/cmd/zdb/zdb.c index 1b8d964d3fc4..cb771a2804de 100644 --- a/cmd/zdb/zdb.c +++ b/cmd/zdb/zdb.c @@ -6139,7 +6139,12 @@ zdb_count_block(zdb_cb_t *zcb, zilog_t *zilog, const blkptr_t *bp, */ int bin; -#define BIN(size) (highbit64(size) - 1) + /* + * Binning strategy: each bin includes blocks up to and including + * the given size (excluding blocks that fit into the previous bin). + * This way, the "4K" bin includes blocks within the (2K; 4K] range. + */ +#define BIN(size) (highbit64((size) - 1)) switch (block_bin_mode) { case BIN_PSIZE: bin = BIN(BP_GET_PSIZE(bp)); break;