Skip to content

Commit 5b52516

Browse files
authored
Mismatched nvlist names in zfs_keys_send_space
This causes "zfs send -vt ..." to fail with: cannot resume send: Unknown error 1030 It turns out that some of the name/value pairs in the verification list for zfs_ioc_send_space(), zfs_keys_send_space, had the wrong name, so the ioctl got kicked out in zfs_check_input_nvpairs(). Update the names accordingly. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: John Poduska <[email protected]> Closes #10978
1 parent 266d112 commit 5b52516

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

module/zfs/zfs_ioctl.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6429,8 +6429,10 @@ send_space_sum(objset_t *os, void *buf, int len, void *arg)
64296429
* presence indicates DRR_WRITE_EMBEDDED records are permitted
64306430
* (optional) "compressok" -> (value ignored)
64316431
* presence indicates compressed DRR_WRITE records are permitted
6432-
* (optional) "rawok" -> (value ignored)
6432+
* (optional) "rawok" -> (value ignored)
64336433
* presence indicates raw encrypted records should be used.
6434+
* (optional) "resume_object" and "resume_offset" -> (uint64)
6435+
* if present, resume send stream from specified object and offset.
64346436
* (optional) "fd" -> file descriptor to use as a cookie for progress
64356437
* tracking (int32)
64366438
* }
@@ -6448,9 +6450,9 @@ static const zfs_ioc_key_t zfs_keys_send_space[] = {
64486450
{"rawok", DATA_TYPE_BOOLEAN, ZK_OPTIONAL},
64496451
{"fd", DATA_TYPE_INT32, ZK_OPTIONAL},
64506452
{"redactbook", DATA_TYPE_STRING, ZK_OPTIONAL},
6451-
{"resumeobj", DATA_TYPE_UINT64, ZK_OPTIONAL},
6452-
{"resumeoff", DATA_TYPE_UINT64, ZK_OPTIONAL},
6453-
{"bytes", DATA_TYPE_UINT64, ZK_OPTIONAL},
6453+
{"resume_object", DATA_TYPE_UINT64, ZK_OPTIONAL},
6454+
{"resume_offset", DATA_TYPE_UINT64, ZK_OPTIONAL},
6455+
{"bytes", DATA_TYPE_UINT64, ZK_OPTIONAL},
64546456
};
64556457

64566458
static int

tests/zfs-tests/tests/functional/rsend/rsend.kshlib

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -635,12 +635,14 @@ function file_check
635635
# $1 The ZFS send command
636636
# $2 The filesystem where the streams are sent
637637
# $3 The receive filesystem
638+
# $4 Test dry-run (optional)
638639
#
639640
function resume_test
640641
{
641-
sendcmd=$1
642-
streamfs=$2
643-
recvfs=$3
642+
typeset sendcmd=$1
643+
typeset streamfs=$2
644+
typeset recvfs=$3
645+
typeset dryrun=${4:-1}
644646

645647
stream_num=1
646648
log_must eval "$sendcmd >/$streamfs/$stream_num"
@@ -651,6 +653,11 @@ function resume_test
651653
stream_num=$((stream_num+1))
652654

653655
token=$(zfs get -Hp -o value receive_resume_token $recvfs)
656+
657+
# Do a dry-run
658+
[ $dryrun -ne 0 ] && \
659+
log_must eval "zfs send -nvt $token > /dev/null"
660+
654661
log_must eval "zfs send -t $token >/$streamfs/$stream_num"
655662
[[ -f /$streamfs/$stream_num ]] || \
656663
log_fail "NO FILE /$streamfs/$stream_num"

tests/zfs-tests/tests/functional/rsend/rsend_024_pos.ksh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ log_onexit resume_cleanup $sendfs $streamfs
4646

4747
test_fs_setup $sendfs $recvfs $streamfs
4848
log_must zfs unmount -f $sendfs
49-
resume_test "zfs send $sendfs" $streamfs $recvfs
49+
resume_test "zfs send $sendfs" $streamfs $recvfs 0
5050
file_check $sendfs $recvfs
5151

5252
log_pass "Verify resumability of a full ZFS send/receive with the source " \

0 commit comments

Comments
 (0)