]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Mismatched nvlist names in zfs_keys_send_space
authorJohn Poduska <jpoduska@datto.com>
Sat, 3 Oct 2020 00:40:46 +0000 (20:40 -0400)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 16 Oct 2020 19:55:19 +0000 (12:55 -0700)
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 <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: John Poduska <jpoduska@datto.com>
Closes #10978

module/zfs/zfs_ioctl.c
tests/zfs-tests/tests/functional/rsend/rsend.kshlib
tests/zfs-tests/tests/functional/rsend/rsend_024_pos.ksh

index eff66b32fcb188f2ddd051b204180a347d00a2f1..d2550750cb7e92aa3b72fc3a94e5dda23208a94f 100644 (file)
@@ -6429,8 +6429,10 @@ send_space_sum(objset_t *os, void *buf, int len, void *arg)
  *         presence indicates DRR_WRITE_EMBEDDED records are permitted
  *     (optional) "compressok" -> (value ignored)
  *         presence indicates compressed DRR_WRITE records are permitted
- *     (optional) "rawok" -> (value ignored)
+ *     (optional) "rawok" -> (value ignored)
  *         presence indicates raw encrypted records should be used.
+ *     (optional) "resume_object" and "resume_offset" -> (uint64)
+ *         if present, resume send stream from specified object and offset.
  *     (optional) "fd" -> file descriptor to use as a cookie for progress
  *         tracking (int32)
  * }
@@ -6448,9 +6450,9 @@ static const zfs_ioc_key_t zfs_keys_send_space[] = {
        {"rawok",               DATA_TYPE_BOOLEAN,      ZK_OPTIONAL},
        {"fd",                  DATA_TYPE_INT32,        ZK_OPTIONAL},
        {"redactbook",          DATA_TYPE_STRING,       ZK_OPTIONAL},
-       {"resumeobj",                   DATA_TYPE_UINT64,       ZK_OPTIONAL},
-       {"resumeoff",                   DATA_TYPE_UINT64,       ZK_OPTIONAL},
-       {"bytes",                       DATA_TYPE_UINT64,       ZK_OPTIONAL},
+       {"resume_object",       DATA_TYPE_UINT64,       ZK_OPTIONAL},
+       {"resume_offset",       DATA_TYPE_UINT64,       ZK_OPTIONAL},
+       {"bytes",               DATA_TYPE_UINT64,       ZK_OPTIONAL},
 };
 
 static int
index c82b0f008e327ce65c83cf16efe1dcb06090f23c..26755e87d0a543077091bdc66456e5d18e4ec646 100644 (file)
@@ -635,12 +635,14 @@ function file_check
 # $1 The ZFS send command
 # $2 The filesystem where the streams are sent
 # $3 The receive filesystem
+# $4 Test dry-run (optional)
 #
 function resume_test
 {
-       sendcmd=$1
-       streamfs=$2
-       recvfs=$3
+       typeset sendcmd=$1
+       typeset streamfs=$2
+       typeset recvfs=$3
+       typeset dryrun=${4:-1}
 
        stream_num=1
        log_must eval "$sendcmd >/$streamfs/$stream_num"
@@ -651,6 +653,11 @@ function resume_test
                stream_num=$((stream_num+1))
 
                token=$(zfs get -Hp -o value receive_resume_token $recvfs)
+
+               # Do a dry-run
+               [ $dryrun -ne 0 ] && \
+                       log_must eval "zfs send -nvt $token > /dev/null"
+
                log_must eval "zfs send -t $token  >/$streamfs/$stream_num"
                [[ -f /$streamfs/$stream_num ]] || \
                    log_fail "NO FILE /$streamfs/$stream_num"
index 2d9fb01af10f44d4445f76cc09eb80acb3ef59a8..c44985ae8c1d491c62e1a9d819d09c1f0a11b44b 100755 (executable)
@@ -46,7 +46,7 @@ log_onexit resume_cleanup $sendfs $streamfs
 
 test_fs_setup $sendfs $recvfs $streamfs
 log_must zfs unmount -f $sendfs
-resume_test "zfs send $sendfs" $streamfs $recvfs
+resume_test "zfs send $sendfs" $streamfs $recvfs 0
 file_check $sendfs $recvfs
 
 log_pass "Verify resumability of a full ZFS send/receive with the source " \