mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-23 02:44:41 +03:00
Illumos #2635: 'zfs rename -f' to perform force unmount
Reviewed by: Matt Ahrens <matt@delphix.com> Reviewed by: George Wilson <George.Wilson@delphix.com> Reviewed by: Bill Pijewski <wdp@joyent.com> Reviewed by: Richard Elling <richard.elling@richardelling.com> Approved by: Richard Lowe <richlowe@richlowe.net> References: https://www.illumos.org/issues/2635 Ported by: Martin Matuska <martin@matuska.org> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #717
This commit is contained in:
committed by
Brian Behlendorf
parent
e346ec25af
commit
db49968e5c
@@ -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 };
|
||||
@@ -3882,7 +3883,8 @@ zfs_rename(zfs_handle_t *zhp, const char *target, boolean_t recursive)
|
||||
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)) {
|
||||
|
||||
Reference in New Issue
Block a user