X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=lib%2Flibzfs%2Flibzfs_dataset.c;h=f216291d296dfe0e76adbdb57afe592ffc61145b;hb=db49968e5ca7814bf833477f27c148208a835a7d;hp=476598cb265298d3f0b251ca34cc6b240c982bb3;hpb=330d06f90d143b41b276796526a66a1c1fff046d;p=zfs.git diff --git a/lib/libzfs/libzfs_dataset.c b/lib/libzfs/libzfs_dataset.c index 476598c..f216291 100644 --- a/lib/libzfs/libzfs_dataset.c +++ b/lib/libzfs/libzfs_dataset.c @@ -3760,7 +3760,8 @@ zfs_rollback(zfs_handle_t *zhp, zfs_handle_t *snap, boolean_t force) * Renames the given dataset. */ int -zfs_rename(zfs_handle_t *zhp, const char *target, boolean_t recursive) +zfs_rename(zfs_handle_t *zhp, const char *target, boolean_t recursive, + boolean_t force_unmount) { int ret; zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; @@ -3875,12 +3876,15 @@ zfs_rename(zfs_handle_t *zhp, const char *target, boolean_t recursive) dd.snapname = delim + 1; /* We remove any zvol links prior to renaming them */ + verify(nvlist_alloc(&dd.nvl, NV_UNIQUE_NAME, 0) == 0); ret = zfs_iter_filesystems(zhrp, zfs_check_snap_cb, &dd); + nvlist_free(dd.nvl); if (ret) { goto error; } } else { - if ((cl = changelist_gather(zhp, ZFS_PROP_NAME, 0, 0)) == NULL) + if ((cl = changelist_gather(zhp, ZFS_PROP_NAME, 0, + force_unmount ? MS_FORCE : 0)) == NULL) return (-1); if (changelist_haszonedchild(cl)) {