mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Fix uninitialized variable snapprops_nvlist in zfs_receive_one
The variable snapprops_nvlist was never initialized, so properties were not applied to the received snapshot. Additionally, add zfs_receive_013_pos.ksh script to ZFS test suite to exercise 'zfs receive' functionality for user properties. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: loli10K <ezomori.nozomu@gmail.com> Closes #4338
This commit is contained in:
@@ -3110,6 +3110,7 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap,
|
||||
ENOENT);
|
||||
|
||||
if (stream_avl != NULL) {
|
||||
nvlist_t *lookup = NULL;
|
||||
nvlist_t *fs = fsavl_find(stream_avl, drrb->drr_toguid,
|
||||
&snapname);
|
||||
|
||||
@@ -3125,6 +3126,10 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap,
|
||||
VERIFY(0 == nvlist_add_uint64(props,
|
||||
zfs_prop_to_name(ZFS_PROP_CANMOUNT), 0));
|
||||
}
|
||||
if (0 == nvlist_lookup_nvlist(fs, "snapprops", &lookup)) {
|
||||
VERIFY(0 == nvlist_lookup_nvlist(lookup,
|
||||
snapname, &snapprops_nvlist));
|
||||
}
|
||||
}
|
||||
|
||||
cp = NULL;
|
||||
|
||||
Reference in New Issue
Block a user