Add display of checksums to zdb -R

The function zdb_read_block (zdb -R) was always intended to have a :c
flag which would read the DVA and length supplied by the user, and
display the checksum. Since we don't know which checksum goes with
the data, we should calculate and display them all.

For each checksum in the table, read in the data at the supplied
DVA:length, calculate the checksum, and display it. Update the man
page and create a zfs test for the new feature.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Kjeld Schouten <kjeld@schouten-lebbing.nl>
Signed-off-by: Paul Zuchowski <pzuchowski@datto.com>
Closes #9607
This commit is contained in:
Paul Zuchowski
2019-11-27 13:08:18 -05:00
committed by Tony Hutter
parent bc21c56c2d
commit c9ac5ec178
5 changed files with 127 additions and 4 deletions
+2
View File
@@ -248,6 +248,8 @@ and, optionally,
.Bl -tag -compact -width "b offset"
.It Sy b Ar offset
Print block pointer
.It Sy c
Calculate and display checksums
.It Sy d
Decompress the block. Set environment variable
.Nm ZDB_NO_ZLE