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

Fail invalid incremental recursive send gracefully #12533

Merged
merged 1 commit into from
Oct 8, 2021

Conversation

ghost
Copy link

@ghost ghost commented Sep 2, 2021

Motivation and Context

Issue #11121

zfs send -R -i snap1 pool/ds@snap1 is an invalid invocation of zfs send
because the incremental source and target snapshots are the same. We
have an error message for this condition, but we don't make it there
because of a failed assert while iterating through the dataset's
snapshots.

Description

Check for NULL to avoid the assert so we can make it to the error
message.

Test this form of invalid send invocation in rsend tests. Fix the
rsend_016_neg test while here: log_neg itself doesn't fail the test,
and writing to /dev/null is not supported on all Linux kernels.

How Has This Been Tested?

zfs send -R -i snap1 pool/ds@snap1 > /dev/null
Added the invalid invocation to an rsend test.

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:

@ghost ghost added Status: Code Review Needed Ready for review and testing Component: Send/Recv "zfs send/recv" feature labels Sep 2, 2021
@ghost
Copy link
Author

ghost commented Sep 20, 2021

  • Rebased

zfs send -R -i snap1 pool/ds@snap1 is an invalid invocation of zfs send
because the incremental source and target snapshots are the same.  We
have an error message for this condition, but we don't make it there
because of a failed assert while iterating through the dataset's
snapshots.

Check for NULL to avoid the assert so we can make it to the error
message.

Test this form of invalid send invocation in rsend tests.  Fix the
rsend_016_neg test while here: log_neg itself doesn't fail the test,
and writing to /dev/null is not supported on all Linux kernels.

Signed-off-by: Ryan Moeller <[email protected]>
@ghost ghost force-pushed the issue-11121 branch from efedd94 to 7a7939a Compare October 7, 2021 17:14
@ghost
Copy link
Author

ghost commented Oct 7, 2021

  • Rebased

@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Oct 7, 2021
Copy link
Contributor

@pcd1193182 pcd1193182 left a comment

Choose a reason for hiding this comment

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

Out of curiosity, what Linux systems don't allow you to write to /dev/null? I thought that its behavior (discard all data written to it) was part of the POSIX spec.

@behlendorf
Copy link
Contributor

@pcd1193182 for all the gory details you'll want to see this #11445 (comment) which links to the upstream kernel discussions. This started with the 5.10 kernel and basically boils down to our need to do the I/O from within the kernel using the kernel_read() and kernel_write(). Sadly since it's all happening kernel side we can't appeal to the POSIX spec. The core issue here remains and PR #11992 contains a WIP fix which it would be great to finally resolve.

@behlendorf behlendorf merged commit 97bbeeb into openzfs:master Oct 8, 2021
@ghost ghost deleted the issue-11121 branch October 11, 2021 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Send/Recv "zfs send/recv" feature Status: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants