aboutsummaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorPaul Dagnelie <[email protected]>2020-03-17 10:30:33 -0700
committerGitHub <[email protected]>2020-03-17 10:30:33 -0700
commit7145123b0ae4d625a419ee357a0df9467b1e8311 (patch)
treed09d3799ab5b2326200f95a32c78b7c8cbfb7625 /module
parent5b3b79559c3206ea5916cbdab72b88344aa6e9a2 (diff)
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 <[email protected]> Reviewed-by: Matthew Ahrens <[email protected]> Signed-off-by: Paul Dagnelie <[email protected]> Closes #10122
Diffstat (limited to 'module')
-rw-r--r--module/zfs/dmu_recv.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/module/zfs/dmu_recv.c b/module/zfs/dmu_recv.c
index 62881753f..9c82cecc6 100644
--- a/module/zfs/dmu_recv.c
+++ b/module/zfs/dmu_recv.c
@@ -1265,10 +1265,11 @@ receive_read(dmu_recv_cookie_t *drc, int len, void *buf)
len - done, &resid);
if (resid == len - done) {
/*
- * Note: ECKSUM indicates that the receive
- * was interrupted and can potentially be resumed.
+ * Note: ECKSUM or ZFS_ERR_STREAM_TRUNCATED indicates
+ * that the receive was interrupted and can
+ * potentially be resumed.
*/
- drc->drc_err = SET_ERROR(ECKSUM);
+ drc->drc_err = SET_ERROR(ZFS_ERR_STREAM_TRUNCATED);
}
drc->drc_voff += len - done - resid;
done = len - resid;