diff options
-rw-r--r-- | lib/libzfs/libzfs_sendrecv.c | 11 | ||||
-rwxr-xr-x | tests/zfs-tests/tests/functional/rsend/rsend_016_neg.ksh | 14 |
2 files changed, 21 insertions, 4 deletions
diff --git a/lib/libzfs/libzfs_sendrecv.c b/lib/libzfs/libzfs_sendrecv.c index fb15f871a..e95f28088 100644 --- a/lib/libzfs/libzfs_sendrecv.c +++ b/lib/libzfs/libzfs_sendrecv.c @@ -1059,9 +1059,14 @@ dump_snapshot(zfs_handle_t *zhp, void *arg) nvlist_t *nvfs = fsavl_find(sdd->fsavl, zhp->zfs_dmustats.dds_guid, &snapname); - snapprops = fnvlist_lookup_nvlist(nvfs, "snapprops"); - snapprops = fnvlist_lookup_nvlist(snapprops, thissnap); - exclude = !nvlist_exists(snapprops, "is_clone_origin"); + if (nvfs != NULL) { + snapprops = fnvlist_lookup_nvlist(nvfs, + "snapprops"); + snapprops = fnvlist_lookup_nvlist(snapprops, + thissnap); + exclude = !nvlist_exists(snapprops, + "is_clone_origin"); + } } else { exclude = B_TRUE; } diff --git a/tests/zfs-tests/tests/functional/rsend/rsend_016_neg.ksh b/tests/zfs-tests/tests/functional/rsend/rsend_016_neg.ksh index 6dfb3423f..26573bfb5 100755 --- a/tests/zfs-tests/tests/functional/rsend/rsend_016_neg.ksh +++ b/tests/zfs-tests/tests/functional/rsend/rsend_016_neg.ksh @@ -24,10 +24,22 @@ # # Strategy: # 1. Perform a zfs incremental send from a bookmark that doesn't exist +# 2. Perform a zfs incremental replication send with incremental source +# same as target (#11121) # verify_runnable "both" -log_neg eval "zfs send -i \#bla $POOl/$FS@final > /dev/null" +function cleanup +{ + rm -f $TEST_BASE_DIR/devnull +} + +log_onexit cleanup + +log_mustnot eval "zfs send -i \#bla $POOl/$FS@final > $TEST_BASE_DIR/devnull" + +log_must eval "zfs send -R -i snapA $POOL/vol@snapA 2>&1 " \ + "> $TEST_BASE_DIR/devnull | grep -q WARNING" log_pass "Ensure that error conditions cause appropriate failures." |