Skip to content

cmd/zfs receive: allow dry-run (-n) to check more #11862

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

Merged
merged 1 commit into from
Apr 12, 2021

Conversation

InsanePrawn
Copy link
Contributor

Motivation and Context

zfs recv -n didn't report some errors it could have.

Description

The code to bail out of the receive if in dry-run mode came a little early, skipping validation of cmdprops (recv -x and -o) among others.

How Has This Been Tested?

Locally, manually:

Before:

$~ zfs send -pw zroot/testvol@a | zfs receive -nv -x canmount zroot/testvol2
would receive full stream of zroot/testvol@a into zroot/testvol2@a

After:

$~ zfs send -pw zroot/testvol@a | ./bin/zfs receive -nv -x canmount zroot/testvol2
would receive full stream of zroot/testvol@a into zroot/testvol2@a
cannot receive new filesystem stream: property 'canmount' does not apply to datasets of this type

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)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

@behlendorf behlendorf added the Status: Code Review Needed Ready for review and testing label Apr 8, 2021
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.

Thanks! I was initially concerned we might not be cleaning everything up by moving this down but it appears that's not an issue. Looks good.

@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Apr 12, 2021
@behlendorf behlendorf merged commit ee6615e into openzfs:master Apr 12, 2021
behlendorf pushed a commit to behlendorf/zfs that referenced this pull request Apr 14, 2021
zfs recv -n does not report some errors it could.  The code to bail 
out of the receive if in dry-run mode came a little early, skipping 
validation of cmdprops (recv -x and -o) among others.  Move the
check down to enable these additional checks.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: InsanePrawn <[email protected]>
Closes openzfs#11862
mcmilk pushed a commit to mcmilk/zfs that referenced this pull request Apr 15, 2021
zfs recv -n does not report some errors it could.  The code to bail 
out of the receive if in dry-run mode came a little early, skipping 
validation of cmdprops (recv -x and -o) among others.  Move the
check down to enable these additional checks.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: InsanePrawn <[email protected]>
Closes openzfs#11862
ghost pushed a commit to truenas/zfs that referenced this pull request May 6, 2021
zfs recv -n does not report some errors it could.  The code to bail 
out of the receive if in dry-run mode came a little early, skipping 
validation of cmdprops (recv -x and -o) among others.  Move the
check down to enable these additional checks.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: InsanePrawn <[email protected]>
Closes openzfs#11862
ghost pushed a commit to truenas/zfs that referenced this pull request May 6, 2021
zfs recv -n does not report some errors it could.  The code to bail 
out of the receive if in dry-run mode came a little early, skipping 
validation of cmdprops (recv -x and -o) among others.  Move the
check down to enable these additional checks.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: InsanePrawn <[email protected]>
Closes openzfs#11862
ghost pushed a commit to truenas/zfs that referenced this pull request May 6, 2021
zfs recv -n does not report some errors it could.  The code to bail 
out of the receive if in dry-run mode came a little early, skipping 
validation of cmdprops (recv -x and -o) among others.  Move the
check down to enable these additional checks.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: InsanePrawn <[email protected]>
Closes openzfs#11862
ghost pushed a commit to truenas/zfs that referenced this pull request May 7, 2021
zfs recv -n does not report some errors it could.  The code to bail 
out of the receive if in dry-run mode came a little early, skipping 
validation of cmdprops (recv -x and -o) among others.  Move the
check down to enable these additional checks.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: InsanePrawn <[email protected]>
Closes openzfs#11862
sempervictus pushed a commit to sempervictus/zfs that referenced this pull request May 31, 2021
zfs recv -n does not report some errors it could.  The code to bail 
out of the receive if in dry-run mode came a little early, skipping 
validation of cmdprops (recv -x and -o) among others.  Move the
check down to enable these additional checks.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: InsanePrawn <[email protected]>
Closes openzfs#11862
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.

2 participants