Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zdb -R should be able to display checksums #9607

Merged
merged 1 commit into from Nov 27, 2019

Conversation

PaulZ-98
Copy link
Contributor

Add display of checksums to zdb -R

Signed-off-by: Paul Zuchowski pzuchowski@datto.com

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.

Motivation and Context

The block comment for zdb_read_block tells us this was an intended feature that never got implemented.

Description

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.

How Has This Been Tested?

Manually and also with new zfs test that obtains the checksum from zdb -ddddddbbbbbb and compares it the zdb -R dva:length:c.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (a change to man pages or other documentation)

Checklist:

Copy link
Contributor

@behlendorf behlendorf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works great! It's nice to see this finally implemented.

@behlendorf behlendorf added the Status: Code Review Needed Ready for review and testing label Nov 21, 2019
Copy link
Contributor

@Ornias1993 Ornias1993 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neatly structured, tests added...
one small nit, but good either way! 👍

cmd/zdb/zdb.c Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Nov 22, 2019

Codecov Report

Merging #9607 into master will decrease coverage by 0.01%.
The diff coverage is 95.83%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9607      +/-   ##
==========================================
- Coverage   79.19%   79.18%   -0.02%     
==========================================
  Files         418      419       +1     
  Lines      123531   123728     +197     
==========================================
+ Hits        97828    97969     +141     
- Misses      25703    25759      +56
Flag Coverage Δ
#kernel 79.71% <ø> (-0.14%) ⬇️
#user 66.72% <95.83%> (-0.19%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0c46813...82eaea5. Read the comment docs.

Signed-off-by: Paul Zuchowski <pzuchowski@datto.com>
@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Nov 22, 2019
@behlendorf behlendorf merged commit 894f669 into openzfs:master Nov 27, 2019
Copy link
Contributor

@dweeezil dweeezil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM. Definitely a nice feature to have, finally. I see it's already been merged.

tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Dec 26, 2019
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 openzfs#9607
tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Dec 27, 2019
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 openzfs#9607
tonyhutter pushed a commit that referenced this pull request Jan 23, 2020
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants