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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this correct? isn't this supposed to be
(embedded && raw)
?https://github.com/zfsonlinux/zfs/blob/681a85cb01a9f83b9f742d8fb634edddc68c5679/module/zfs/dmu_recv.c#L398-L400
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
encrypted is not the same as raw. encrypted means that the resulting dataset from the receive was encrypted. Raw means that the encrypted dataset was sent using the raw send feature flag. It is confusing, and a guess at best, but this code should be more accurate than what is there now. I have proposed more general fixes for error reporting in cases like this, which I will hopefully get to some time soon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i also found this:
https://github.com/zfsonlinux/zfs/blob/681a85cb01a9f83b9f742d8fb634edddc68c5679/module/zfs/dmu_recv.c#L573-L580
unless i'm missing something we should theoretically handle EINVAL when both
DMU_BACKUP_FEATURE_RAW
andDMU_BACKUP_FEATURE_EMBED_DATA
are setThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That should never happen. The flags are mutually exclusive on the send side. There are many places where the recv code can return EINVAL that will be misinterpreted. The idea of this patch is not to correct all of these cases, but simply to make this case (that a few people have hit) function as it was originally intended. We will address the broader problem of badly interpreted error codes in another pull request.