mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 10:37:35 +03:00
Fix 'zfs receive -o' when used with '-e|-d'
When used in conjunction with one of '-e' or '-d' zfs receive options none of the properties requested to be set (-o) are actually applied: this is caused by a wrong assumption made about the toplevel dataset in zfs_receive_one(). Fix this by correctly detecting the toplevel dataset. Reviewed-by: Tony Hutter <hutter2@llnl.gov> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: loli10K <ezomori.nozomu@gmail.com> Closes #7088 Requires-spl: refs/pull/679/head
This commit is contained in:
@@ -3252,7 +3252,7 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap,
|
||||
nvlist_t *oxprops = NULL; /* override (-o) and exclude (-x) props */
|
||||
nvlist_t *origprops = NULL; /* original props (if destination exists) */
|
||||
zfs_type_t type;
|
||||
boolean_t toplevel;
|
||||
boolean_t toplevel = B_FALSE;
|
||||
boolean_t zoned = B_FALSE;
|
||||
|
||||
begin_time = time(NULL);
|
||||
@@ -3586,7 +3586,8 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap,
|
||||
goto out;
|
||||
}
|
||||
|
||||
toplevel = chopprefix[0] != '/';
|
||||
if (top_zfs && *top_zfs == NULL)
|
||||
toplevel = B_TRUE;
|
||||
if (drrb->drr_type == DMU_OST_ZVOL) {
|
||||
type = ZFS_TYPE_VOLUME;
|
||||
} else if (drrb->drr_type == DMU_OST_ZFS) {
|
||||
|
||||
Reference in New Issue
Block a user