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

Return EFAULT at the end of zfs_write if set #11193

Merged
merged 2 commits into from Nov 14, 2020

Conversation

ghost
Copy link

@ghost ghost commented Nov 11, 2020

Motivation and Context

FreeBSD expects some error from zfs_write if we didn't complete the full write.
This fixes the frequent failures in compression/compress_003_pos.

Description

Return error instead of 0 at the end of zfs_write.

I noticed a few locations missing SET_ERROR while here, so they have been added in a separate commit.

How Has This Been Tested?

I ran the compression tests on FreeBSD to confirm compress_003_pos passed. More testing will be needed to see if the change negatively affects Linux.

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:

@ghost ghost added the Status: Code Review Needed Ready for review and testing label Nov 11, 2020
@ghost ghost changed the title Zfs write efault Return the error at the end of zfs_write Nov 11, 2020
@ghost ghost changed the title Return the error at the end of zfs_write Return EFAULT at the end of zfs_write if set Nov 11, 2020
@ghost
Copy link
Author

ghost commented Nov 11, 2020

Bah, I'll fix the style after I see the test results.

Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
@ghost ghost marked this pull request as ready for review November 12, 2020 07:01
FreeBSD's VFS expects EFAULT from zfs_write if we didn't complete the
full write so it can retry the operation.

Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
@ghost
Copy link
Author

ghost commented Nov 12, 2020

  • Updated comment describing error cases

@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Nov 13, 2020
@behlendorf behlendorf merged commit 7e3617d into openzfs:master Nov 14, 2020
@ghost ghost deleted the zfs_write-efault branch November 16, 2020 05:52
behlendorf pushed a commit that referenced this pull request Dec 23, 2020
FreeBSD's VFS expects EFAULT from zfs_write() if we didn't complete
the full write so it can retry the operation.  Add some missing
SET_ERRORs in zfs_write().

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #11193
jsai20 pushed a commit to jsai20/zfs that referenced this pull request Mar 30, 2021
FreeBSD's VFS expects EFAULT from zfs_write() if we didn't complete
the full write so it can retry the operation.  Add some missing
SET_ERRORs in zfs_write().

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes openzfs#11193
sempervictus pushed a commit to sempervictus/zfs that referenced this pull request May 31, 2021
FreeBSD's VFS expects EFAULT from zfs_write() if we didn't complete
the full write so it can retry the operation.  Add some missing
SET_ERRORs in zfs_write().

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes openzfs#11193
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

1 participant