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

Change the error handling for invalid property values during receive #10631

Merged
merged 1 commit into from
Aug 1, 2020

Conversation

allanjude
Copy link
Contributor

Signed-off-by: Allan Jude allan@klarasystems.com

Motivation and Context

zfs recv should return a useful error message when an invalid index
property value is provided in the send stream properties nvlist

Description

With a compression= property outside of the understood range:

Before:

receiving full stream of zof/zstd_send@send2 into testpool/recv@send2
internal error: Invalid argument
Aborted (core dumped)

Note: the recv completes successfully, the abort() is likely just to
make it easier to track the unexpected error code.

After:

receiving full stream of zof/zstd_send@send2 into testpool/recv@send2
cannot receive compression property on testpool/recv: invalid property value
received 28.9M stream in 1 seconds (28.9M/sec)

How Has This Been Tested?

zfs send from a system with ZSTD support, to a system without ZSTD support

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.
  • I have run the ZFS Test Suite with this change applied.
  • All commit messages are properly formatted and contain Signed-off-by.

@codecov
Copy link

codecov bot commented Jul 28, 2020

Codecov Report

Merging #10631 into master will increase coverage by 0.42%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10631      +/-   ##
==========================================
+ Coverage   79.55%   79.97%   +0.42%     
==========================================
  Files         394      394              
  Lines      124631   124637       +6     
==========================================
+ Hits        99146    99679     +533     
+ Misses      25485    24958     -527     
Flag Coverage Δ
#kernel 80.46% <0.00%> (+0.33%) ⬆️
#user 66.23% <0.00%> (+1.30%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
lib/libzfs/libzfs_util.c 72.58% <0.00%> (-0.43%) ⬇️
module/zfs/zfs_ioctl.c 86.48% <0.00%> (ø)
module/zfs/vdev_indirect.c 73.50% <0.00%> (-11.50%) ⬇️
module/os/linux/spl/spl-kmem-cache.c 87.87% <0.00%> (-1.00%) ⬇️
cmd/zed/agents/zfs_mod.c 77.55% <0.00%> (-0.67%) ⬇️
module/zfs/vdev_indirect_mapping.c 98.55% <0.00%> (-0.49%) ⬇️
module/os/linux/zfs/zpl_xattr.c 83.26% <0.00%> (-0.43%) ⬇️
module/zfs/zvol.c 84.06% <0.00%> (-0.34%) ⬇️
lib/libefi/rdwr_efi.c 60.37% <0.00%> (-0.32%) ⬇️
module/zfs/range_tree.c 93.60% <0.00%> (-0.26%) ⬇️
... and 65 more

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 25499e2...e0bd009. Read the comment docs.

@allanjude allanjude force-pushed the openzfs_zstd_compat branch 2 times, most recently from 95ad0e5 to 2d76775 Compare July 30, 2020 21:08
@allanjude
Copy link
Contributor Author

Updated pyzfs tests to handle the new error code. They will still fail until #10649 is merged

@behlendorf
Copy link
Contributor

#10649 has been merged. Would you mind rebasing this on the latest so we can get a fresh test run.

ZFS recv should return a useful error message when an invalid index
property value is provided in the send stream properties nvlist

With a compression= property outside of the understood range:

Before:
```
receiving full stream of zof/zstd_send@send2 into testpool/recv@send2
internal error: Invalid argument
Aborted (core dumped)
```
Note: the recv completes successfully, the abort() is likely just to
make it easier to track the unexpected error code.

After:
```
receiving full stream of zof/zstd_send@send2 into testpool/recv@send2
cannot receive compression property on testpool/recv: invalid property
value received 28.9M stream in 1 seconds (28.9M/sec)
```

Signed-off-by: Allan Jude <allan@klarasystems.com>
@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Aug 1, 2020
@behlendorf behlendorf merged commit 8fb79fd into openzfs:master Aug 1, 2020
@behlendorf behlendorf removed this from To do in 0.8-release Dec 18, 2020
jsai20 pushed a commit to jsai20/zfs that referenced this pull request Mar 30, 2021
ZFS recv should return a useful error message when an invalid index
property value is provided in the send stream properties nvlist

With a compression= property outside of the understood range:

Before:
```
receiving full stream of zof/zstd_send@send2 into testpool/recv@send2
internal error: Invalid argument
Aborted (core dumped)
```
Note: the recv completes successfully, the abort() is likely just to
make it easier to track the unexpected error code.

After:
```
receiving full stream of zof/zstd_send@send2 into testpool/recv@send2
cannot receive compression property on testpool/recv: invalid property
value received 28.9M stream in 1 seconds (28.9M/sec)
```

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Allan Jude <allan@klarasystems.com>
Closes openzfs#10631
sempervictus pushed a commit to sempervictus/zfs that referenced this pull request May 31, 2021
ZFS recv should return a useful error message when an invalid index
property value is provided in the send stream properties nvlist

With a compression= property outside of the understood range:

Before:
```
receiving full stream of zof/zstd_send@send2 into testpool/recv@send2
internal error: Invalid argument
Aborted (core dumped)
```
Note: the recv completes successfully, the abort() is likely just to
make it easier to track the unexpected error code.

After:
```
receiving full stream of zof/zstd_send@send2 into testpool/recv@send2
cannot receive compression property on testpool/recv: invalid property
value received 28.9M stream in 1 seconds (28.9M/sec)
```

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Allan Jude <allan@klarasystems.com>
Closes openzfs#10631
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

2 participants