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

Fix noop receive of raw send stream #9221

Merged
merged 1 commit into from
Sep 5, 2019

Conversation

tcaputi
Copy link
Contributor

@tcaputi tcaputi commented Aug 27, 2019

Currently, the noop receive code fails to work with raw send streams
and resuming send streams. This happens because zfs_receive_impl()
reads the DRR_BEGIN payload without reading the payload itself.
Normally, the kernel expects to read this itself, but in this case
the recv_skip() code runs instead and it is not prepared to handle
the stream being left at any place other than the beginning of a
record.

This patch resolves this issue by manually reading the DRR_BEGIN
payload in the dry-run case. This patch also includes a number of
small fixups in this code path.

Fixes: #9173

Signed-off-by: Tom Caputi [email protected]

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:

@tcaputi tcaputi force-pushed the fix_raw_dryrun_receive branch from 277b806 to fa0c53d Compare August 28, 2019 14:28
@behlendorf behlendorf added the Status: Code Review Needed Ready for review and testing label Aug 28, 2019
@behlendorf
Copy link
Contributor

@tcaputi would you mind rebasing this when you get a moment. A minor conflict was introduced and needs to be resolved.

@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Sep 4, 2019
Currently, the noop receive code fails to work with raw send streams
and resuming send streams. This happens because zfs_receive_impl()
reads the DRR_BEGIN payload without reading the payload itself.
Normally, the kernel expects to read this itself, but in this case
the recv_skip() code runs instead and it is not prepared to handle
the stream being left at any place other than the beginning of a
record.

This patch resolves this issue by manually reading the DRR_BEGIN
payload in the dry-run case. This patch also includes a number of
small fixups in this code path.

Fixes: openzfs#9173

Signed-off-by: Tom Caputi <[email protected]>
@tcaputi tcaputi force-pushed the fix_raw_dryrun_receive branch from fa0c53d to 4d5f236 Compare September 5, 2019 17:40
@behlendorf behlendorf merged commit 870e7a5 into openzfs:master Sep 5, 2019
@codecov
Copy link

codecov bot commented Sep 6, 2019

Codecov Report

Merging #9221 into master will decrease coverage by 0.03%.
The diff coverage is 53.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9221      +/-   ##
==========================================
- Coverage   79.14%    79.1%   -0.04%     
==========================================
  Files         401      401              
  Lines      122053   122063      +10     
==========================================
- Hits        96593    96557      -36     
- Misses      25460    25506      +46
Flag Coverage Δ
#kernel 79.69% <ø> (-0.07%) ⬇️
#user 66.94% <53.33%> (-0.02%) ⬇️

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 65a91b1...4d5f236. Read the comment docs.

tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Dec 24, 2019
Currently, the noop receive code fails to work with raw send streams
and resuming send streams. This happens because zfs_receive_impl()
reads the DRR_BEGIN payload without reading the payload itself.
Normally, the kernel expects to read this itself, but in this case
the recv_skip() code runs instead and it is not prepared to handle
the stream being left at any place other than the beginning of a
record.

This patch resolves this issue by manually reading the DRR_BEGIN
payload in the dry-run case. This patch also includes a number of
small fixups in this code path.

Reviewed-by: George Melikov <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Paul Dagnelie <[email protected]>
Signed-off-by: Tom Caputi <[email protected]>
Closes openzfs#9221
Closes openzfs#9173
tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Dec 27, 2019
Currently, the noop receive code fails to work with raw send streams
and resuming send streams. This happens because zfs_receive_impl()
reads the DRR_BEGIN payload without reading the payload itself.
Normally, the kernel expects to read this itself, but in this case
the recv_skip() code runs instead and it is not prepared to handle
the stream being left at any place other than the beginning of a
record.

This patch resolves this issue by manually reading the DRR_BEGIN
payload in the dry-run case. This patch also includes a number of
small fixups in this code path.

Reviewed-by: George Melikov <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Paul Dagnelie <[email protected]>
Signed-off-by: Tom Caputi <[email protected]>
Closes openzfs#9221
Closes openzfs#9173
tonyhutter pushed a commit that referenced this pull request Jan 23, 2020
Currently, the noop receive code fails to work with raw send streams
and resuming send streams. This happens because zfs_receive_impl()
reads the DRR_BEGIN payload without reading the payload itself.
Normally, the kernel expects to read this itself, but in this case
the recv_skip() code runs instead and it is not prepared to handle
the stream being left at any place other than the beginning of a
record.

This patch resolves this issue by manually reading the DRR_BEGIN
payload in the dry-run case. This patch also includes a number of
small fixups in this code path.

Reviewed-by: George Melikov <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Paul Dagnelie <[email protected]>
Signed-off-by: Tom Caputi <[email protected]>
Closes #9221
Closes #9173
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.

Raw encrypted send stream can't be dry-run received: invalid record type
4 participants