From 3cbe89b12a55a0ff350d7434834f4f48227896a3 Mon Sep 17 00:00:00 2001 From: LOLi Date: Tue, 1 May 2018 05:58:29 +0200 Subject: Fix zfs incremental send remove '-o' properties When receiving an incremental send stream with intermediary snapshots zfs_receive_one() does not correctly identify the top-level dataset: consequently we restore said snapshots as if they were children datasets in the hierarchy, forcing inheritance of any property received with 'zfs send -o' and effectively removing any locally set value. The test case did not correctly verify this situation because it uses adjacent snapshots, basically testing 'zfs send -i' instead of 'zfs send -I': this commit adds an additional intermediary snapshot to the test script. Reviewed-by: Paul Dagnelie Reviewed-by: Brian Behlendorf Signed-off-by: loli10K Closes #7478 --- lib/libzfs/libzfs_sendrecv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/libzfs/libzfs_sendrecv.c b/lib/libzfs/libzfs_sendrecv.c index b138745b8..9a4f373a1 100644 --- a/lib/libzfs/libzfs_sendrecv.c +++ b/lib/libzfs/libzfs_sendrecv.c @@ -4041,7 +4041,7 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap, goto out; } - if (top_zfs && *top_zfs == NULL) + if (top_zfs && (*top_zfs == NULL || strcmp(*top_zfs, name) == 0)) toplevel = B_TRUE; if (drrb->drr_type == DMU_OST_ZVOL) { type = ZFS_TYPE_VOLUME; -- cgit v1.2.3