-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
libzfs: Fail making a dataset handle gracefully #13077
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ghost
force-pushed
the
invalid_dataset_handle
branch
2 times, most recently
from
February 11, 2022 17:18
c787e99
to
728f631
Compare
When a dataset is in the process of being received it gets marked as inconsistent and should not be used. We should check for this when opening a dataset handle in libzfs and return with an appropriate error set, rather than hitting an abort because of the incomplete data. zfs_open() passes errno to zfs_standard_error() after observing make_dataset_handle() fail, which ends up aborting if errno is 0. Set errno before returning where we know it has not been set already. Signed-off-by: Ryan Moeller <freqlabs@FreeBSD.org>
ghost
force-pushed
the
invalid_dataset_handle
branch
from
February 11, 2022 17:32
728f631
to
2820724
Compare
ghost
added
Status: Code Review Needed
Ready for review and testing
and removed
Status: Work in Progress
Not yet ready for general review
labels
Feb 14, 2022
behlendorf
approved these changes
Feb 18, 2022
behlendorf
added
Status: Accepted
Ready to integrate (reviewed, tested)
and removed
Status: Code Review Needed
Ready for review and testing
labels
Feb 18, 2022
ghost
deleted the
invalid_dataset_handle
branch
February 18, 2022 23:12
ghost
pushed a commit
to truenas/zfs
that referenced
this pull request
Feb 22, 2022
When a dataset is in the process of being received it gets marked as inconsistent and should not be used. We should check for this when opening a dataset handle in libzfs and return with an appropriate error set, rather than hitting an abort because of the incomplete data. zfs_open() passes errno to zfs_standard_error() after observing make_dataset_handle() fail, which ends up aborting if errno is 0. Set errno before returning where we know it has not been set already. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ryan Moeller <freqlabs@FreeBSD.org> Closes openzfs#13077
ghost
mentioned this pull request
Feb 22, 2022
tonyhutter
pushed a commit
to tonyhutter/zfs
that referenced
this pull request
Jun 7, 2022
When a dataset is in the process of being received it gets marked as inconsistent and should not be used. We should check for this when opening a dataset handle in libzfs and return with an appropriate error set, rather than hitting an abort because of the incomplete data. zfs_open() passes errno to zfs_standard_error() after observing make_dataset_handle() fail, which ends up aborting if errno is 0. Set errno before returning where we know it has not been set already. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ryan Moeller <freqlabs@FreeBSD.org> Closes openzfs#13077
nicman23
pushed a commit
to nicman23/zfs
that referenced
this pull request
Aug 22, 2022
When a dataset is in the process of being received it gets marked as inconsistent and should not be used. We should check for this when opening a dataset handle in libzfs and return with an appropriate error set, rather than hitting an abort because of the incomplete data. zfs_open() passes errno to zfs_standard_error() after observing make_dataset_handle() fail, which ends up aborting if errno is 0. Set errno before returning where we know it has not been set already. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ryan Moeller <freqlabs@FreeBSD.org> Closes openzfs#13077
nicman23
pushed a commit
to nicman23/zfs
that referenced
this pull request
Aug 22, 2022
When a dataset is in the process of being received it gets marked as inconsistent and should not be used. We should check for this when opening a dataset handle in libzfs and return with an appropriate error set, rather than hitting an abort because of the incomplete data. zfs_open() passes errno to zfs_standard_error() after observing make_dataset_handle() fail, which ends up aborting if errno is 0. Set errno before returning where we know it has not been set already. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ryan Moeller <freqlabs@FreeBSD.org> Closes openzfs#13077
andrewc12
pushed a commit
to andrewc12/openzfs
that referenced
this pull request
Aug 30, 2022
When a dataset is in the process of being received it gets marked as inconsistent and should not be used. We should check for this when opening a dataset handle in libzfs and return with an appropriate error set, rather than hitting an abort because of the incomplete data. zfs_open() passes errno to zfs_standard_error() after observing make_dataset_handle() fail, which ends up aborting if errno is 0. Set errno before returning where we know it has not been set already. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ryan Moeller <freqlabs@FreeBSD.org> Closes openzfs#13077
lundman
pushed a commit
to openzfsonwindows/openzfs
that referenced
this pull request
Sep 1, 2022
When a dataset is in the process of being received it gets marked as inconsistent and should not be used. We should check for this when opening a dataset handle in libzfs and return with an appropriate error set, rather than hitting an abort because of the incomplete data. zfs_open() passes errno to zfs_standard_error() after observing make_dataset_handle() fail, which ends up aborting if errno is 0. Set errno before returning where we know it has not been set already. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ryan Moeller <freqlabs@FreeBSD.org> Closes openzfs#13077
andrewc12
pushed a commit
to andrewc12/openzfs
that referenced
this pull request
Sep 23, 2022
When a dataset is in the process of being received it gets marked as inconsistent and should not be used. We should check for this when opening a dataset handle in libzfs and return with an appropriate error set, rather than hitting an abort because of the incomplete data. zfs_open() passes errno to zfs_standard_error() after observing make_dataset_handle() fail, which ends up aborting if errno is 0. Set errno before returning where we know it has not been set already. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ryan Moeller <freqlabs@FreeBSD.org> Closes openzfs#13077
andrewc12
pushed a commit
to andrewc12/openzfs
that referenced
this pull request
Sep 23, 2022
When a dataset is in the process of being received it gets marked as inconsistent and should not be used. We should check for this when opening a dataset handle in libzfs and return with an appropriate error set, rather than hitting an abort because of the incomplete data. zfs_open() passes errno to zfs_standard_error() after observing make_dataset_handle() fail, which ends up aborting if errno is 0. Set errno before returning where we know it has not been set already. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ryan Moeller <freqlabs@FreeBSD.org> Closes openzfs#13077
andrewc12
pushed a commit
to andrewc12/openzfs
that referenced
this pull request
Sep 23, 2022
When a dataset is in the process of being received it gets marked as inconsistent and should not be used. We should check for this when opening a dataset handle in libzfs and return with an appropriate error set, rather than hitting an abort because of the incomplete data. zfs_open() passes errno to zfs_standard_error() after observing make_dataset_handle() fail, which ends up aborting if errno is 0. Set errno before returning where we know it has not been set already. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ryan Moeller <freqlabs@FreeBSD.org> Closes openzfs#13077
andrewc12
pushed a commit
to andrewc12/openzfs
that referenced
this pull request
Sep 23, 2022
When a dataset is in the process of being received it gets marked as inconsistent and should not be used. We should check for this when opening a dataset handle in libzfs and return with an appropriate error set, rather than hitting an abort because of the incomplete data. zfs_open() passes errno to zfs_standard_error() after observing make_dataset_handle() fail, which ends up aborting if errno is 0. Set errno before returning where we know it has not been set already. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ryan Moeller <freqlabs@FreeBSD.org> Closes openzfs#13077
andrewc12
pushed a commit
to andrewc12/openzfs
that referenced
this pull request
Sep 23, 2022
When a dataset is in the process of being received it gets marked as inconsistent and should not be used. We should check for this when opening a dataset handle in libzfs and return with an appropriate error set, rather than hitting an abort because of the incomplete data. zfs_open() passes errno to zfs_standard_error() after observing make_dataset_handle() fail, which ends up aborting if errno is 0. Set errno before returning where we know it has not been set already. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ryan Moeller <freqlabs@FreeBSD.org> Closes openzfs#13077
snajpa
pushed a commit
to vpsfreecz/zfs
that referenced
this pull request
Oct 22, 2022
When a dataset is in the process of being received it gets marked as inconsistent and should not be used. We should check for this when opening a dataset handle in libzfs and return with an appropriate error set, rather than hitting an abort because of the incomplete data. zfs_open() passes errno to zfs_standard_error() after observing make_dataset_handle() fail, which ends up aborting if errno is 0. Set errno before returning where we know it has not been set already. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ryan Moeller <freqlabs@FreeBSD.org> Closes openzfs#13077
snajpa
pushed a commit
to vpsfreecz/zfs
that referenced
this pull request
Oct 22, 2022
When a dataset is in the process of being received it gets marked as inconsistent and should not be used. We should check for this when opening a dataset handle in libzfs and return with an appropriate error set, rather than hitting an abort because of the incomplete data. zfs_open() passes errno to zfs_standard_error() after observing make_dataset_handle() fail, which ends up aborting if errno is 0. Set errno before returning where we know it has not been set already. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ryan Moeller <freqlabs@FreeBSD.org> Closes openzfs#13077
snajpa
pushed a commit
to vpsfreecz/zfs
that referenced
this pull request
Oct 23, 2022
When a dataset is in the process of being received it gets marked as inconsistent and should not be used. We should check for this when opening a dataset handle in libzfs and return with an appropriate error set, rather than hitting an abort because of the incomplete data. zfs_open() passes errno to zfs_standard_error() after observing make_dataset_handle() fail, which ends up aborting if errno is 0. Set errno before returning where we know it has not been set already. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ryan Moeller <freqlabs@FreeBSD.org> Closes openzfs#13077
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation and Context
When a dataset is in the process of being received it gets marked as
inconsistent and should not be used. We should check for this when
opening a dataset handle in libzfs and return with an appropriate error
set, rather than hitting an abort because of the incomplete data.
Description
Check dds_inconsistent in make_dataset_handle_common().
zfs_open() passes errno to zfs_standard_error() after observing
make_dataset_handle() fail, which ends up aborting if errno is 0.
Set errno before returning where we know it has not been set already.
How Has This Been Tested?
Types of changes
Checklist:
Signed-off-by
.