mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2025-01-13 19:50:25 +03:00
zfs_receive_one: Check for the more likely error first
If zfs_receive_one() gets back EINVAL, check for the more likely case, embedded block pointers + encryption and return that error, before falling back to the less likely case, a resumable stream when the kernel has not been upgraded to support resume. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Allan Jude <allan@klarasystems.com> Sponsored-by: rsync.net Sponsored-by: Klara Inc. Closes #14379
This commit is contained in:
parent
856cefcd1c
commit
63267f7f77
@ -5117,14 +5117,14 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap,
|
|||||||
*cp = '@';
|
*cp = '@';
|
||||||
break;
|
break;
|
||||||
case EINVAL:
|
case EINVAL:
|
||||||
if (flags->resumable) {
|
if (embedded && !raw) {
|
||||||
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
|
|
||||||
"kernel modules must be upgraded to "
|
|
||||||
"receive this stream."));
|
|
||||||
} else if (embedded && !raw) {
|
|
||||||
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
|
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
|
||||||
"incompatible embedded data stream "
|
"incompatible embedded data stream "
|
||||||
"feature with encrypted receive."));
|
"feature with encrypted receive."));
|
||||||
|
} else if (flags->resumable) {
|
||||||
|
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
|
||||||
|
"kernel modules must be upgraded to "
|
||||||
|
"receive this stream."));
|
||||||
}
|
}
|
||||||
(void) zfs_error(hdl, EZFS_BADSTREAM, errbuf);
|
(void) zfs_error(hdl, EZFS_BADSTREAM, errbuf);
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user