mirror_zfs/cmd
Andriy Tkachuk 4bd7a2eaa5
zdb: fix checksum calculation for decompressed blocks
Currently, when reading compressed blocks with -R and decompressing
them with :d option and specifying lsize, which is normally bigger
than psize for compressed blocks, the checksum is calculated on
decompressed data. But it makes no sense since zfs always calculates
checksum on physical, i.e. compressed data. So reading the same block
produces different checksum results depending on how we read it,
whether we decompress it or not, which, again, makes no sense.

Fix: use psize instead of lsize when calculating the checksum so that
it is always calculated on the physical block size, no matter was it
compressed or not.

Signed-off-by: Andriy Tkachuk <andriy.tkachuk@seagate.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com>
Closes #17547
2025-07-24 21:24:15 -04:00
..
raidz_test SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zdb zdb: fix checksum calculation for decompressed blocks 2025-07-24 21:24:15 -04:00
zed ZED: Fix device type detection and pool iteration logic 2025-07-24 15:47:46 -07:00
zfs everywhere: misc unnecessary var init/update 2025-07-22 15:23:58 -07:00
zinject Multiple printf() size fixes (#17199) 2025-04-01 15:27:03 -07:00
zpool everywhere: misc unnecessary var init/update 2025-07-22 15:23:58 -07:00
zpool_influxdb SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zstream SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
arc_summary add uncompressed_size to arc_summary 2025-07-22 15:06:09 -07:00
arcstat.in arcstat: prevent ZeroDivisionError when L2ARC becomes empty 2025-05-19 16:27:24 -07:00
dbufstat.in SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
fsck.zfs.in cmd: move single-file binaries up, extract udev programs to udev/ 2022-05-10 10:20:34 -07:00
Makefile.am build: rename FORCEDEBUG_CPPFLAGS to LIBZPOOL_CPPFLAGS 2024-08-27 12:53:27 -07:00
mount_zfs.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zfs_ids_to_path.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zgenhostid.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zhack.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zilstat.in SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
ztest.c everywhere: misc unnecessary var init/update 2025-07-22 15:23:58 -07:00
zvol_wait zvol_wait logic may terminate prematurely 2022-10-11 12:12:04 -07:00