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

Incorrect maximum DVA value in DDE_GET_NDVAS() #7234

Merged
merged 1 commit into from
Feb 26, 2018

Conversation

dweeezil
Copy link
Contributor

The conditional was reversed which caused garbage values to be used when
calculating dds_ref_dsize.

Description

Fixed the conditional.

Motivation and Context

Discovered while porting the vdev evacuation code. This problem caused bogus values to be stored both in-core and on-disk for dds_ref_dsize which should show up in, for example, zpool status -D <pool> as wild values for DSIZE. It has the effect of, among other things, causing dsl_pool_adjustedsize() to return bogus values.

How Has This Been Tested?

I used the following reproducer script and observed the value of DSIZE:

#!/bin/sh

truncate -s 1g tank.img
zpool create tank $(pwd)/tank.img
[ -f tank.key ] || dd if=/dev/urandom of=tank.key bs=32 count=1 > /dev/null 2>&1
zfs create -o dedup=on -o encryption=on -o keyformat=raw -o keylocation=file://`pwd`/tank.key tank/fs
yes | dd bs=1M count=100 iflag=fullblock of=/tank/fs/yes
zpool status -D tank

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:

  • My code follows the ZFS on Linux code style requirements.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • All commit messages are properly formatted and contain Signed-off-by.
  • Change has been approved by a ZFS on Linux member.

The conditional was reversed which caused garbage values to be used when
calculating dds_ref_dsize.

Signed-off-by: Tim Chase <tim@chase2k.com>
@codecov
Copy link

codecov bot commented Feb 26, 2018

Codecov Report

Merging #7234 into master will decrease coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7234      +/-   ##
==========================================
- Coverage   76.52%   76.51%   -0.02%     
==========================================
  Files         327      327              
  Lines      103864   103864              
==========================================
- Hits        79487    79473      -14     
- Misses      24377    24391      +14
Flag Coverage Δ
#kernel 76.38% <ø> (+0.09%) ⬆️
#user 65.96% <ø> (-0.03%) ⬇️

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 2a0428f...7ddc121. Read the comment docs.

@behlendorf behlendorf requested a review from tcaputi February 26, 2018 17:21
Copy link
Contributor

@tcaputi tcaputi left a comment

Choose a reason for hiding this comment

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

whoops. Sorry about that. Thanks for fixing this.

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.

Nice work! LGTM.

@behlendorf behlendorf merged commit 8b58143 into openzfs:master Feb 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants