mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Separate warning for incomplete and corrupt streams
This change adds a separate return code to zfs_ioc_recv that is used for incomplete streams, in addition to the existing return code for streams that contain corruption. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Matthew Ahrens <mahrens@delphix.com> Signed-off-by: Paul Dagnelie <pcd@delphix.com> Closes #10122
This commit is contained in:
@@ -4253,12 +4253,12 @@ recv_skip(libzfs_handle_t *hdl, int fd, boolean_t byteswap)
|
||||
|
||||
static void
|
||||
recv_ecksum_set_aux(libzfs_handle_t *hdl, const char *target_snap,
|
||||
boolean_t resumable)
|
||||
boolean_t resumable, boolean_t checksum)
|
||||
{
|
||||
char target_fs[ZFS_MAX_DATASET_NAME_LEN];
|
||||
|
||||
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
|
||||
"checksum mismatch or incomplete stream"));
|
||||
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, (checksum ?
|
||||
"checksum mismatch" : "incomplete stream")));
|
||||
|
||||
if (!resumable)
|
||||
return;
|
||||
@@ -5206,7 +5206,9 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap,
|
||||
(void) zfs_error(hdl, EZFS_BADSTREAM, errbuf);
|
||||
break;
|
||||
case ECKSUM:
|
||||
recv_ecksum_set_aux(hdl, destsnap, flags->resumable);
|
||||
case ZFS_ERR_STREAM_TRUNCATED:
|
||||
recv_ecksum_set_aux(hdl, destsnap, flags->resumable,
|
||||
ioctl_err == ECKSUM);
|
||||
(void) zfs_error(hdl, EZFS_BADSTREAM, errbuf);
|
||||
break;
|
||||
case ENOTSUP:
|
||||
|
||||
Reference in New Issue
Block a user