From 6ddfc4be821a3643011dcd3505275fa1706259a7 Mon Sep 17 00:00:00 2001 From: mm Date: Fri, 22 Jun 2012 20:38:08 +0000 Subject: [PATCH] MFC r237119: Do not remount ZFS dataset if changing canmount property to "on" and dataset is already mounted. PR: 167905 Submitted by: Bryan Drewery git-svn-id: svn://svn.freebsd.org/base/stable/8@237457 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c index fcd43a03c..1d81f91f5 100644 --- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c +++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c @@ -1485,11 +1485,13 @@ zfs_prop_set(zfs_handle_t *zhp, const char *propname, const char *propval) /* * If the dataset's canmount property is being set to noauto, + * or being set to on and the dataset is already mounted, * then we want to prevent unmounting & remounting it. */ do_prefix = !((prop == ZFS_PROP_CANMOUNT) && (zprop_string_to_index(prop, propval, &idx, - ZFS_TYPE_DATASET) == 0) && (idx == ZFS_CANMOUNT_NOAUTO)); + ZFS_TYPE_DATASET) == 0) && (idx == ZFS_CANMOUNT_NOAUTO || + (idx == ZFS_CANMOUNT_ON && zfs_is_mounted(zhp, NULL)))); if (do_prefix && (ret = changelist_prefix(cl)) != 0) goto error; -- 2.45.0