summaryrefslogtreecommitdiffstats
path: root/cddl/contrib/opensolaris
diff options
context:
space:
mode:
authoravg <avg@FreeBSD.org>2016-04-03 07:42:13 +0000
committeravg <avg@FreeBSD.org>2016-04-03 07:42:13 +0000
commit3c617afe6f35f75f6c130b29414371425e535c66 (patch)
tree469d99d8ec3a38e2111874b895e06f3565b6a9d6 /cddl/contrib/opensolaris
parent6ba2768c8e47103fa98249ad322514fdb95fdb8c (diff)
downloadFreeBSD-src-3c617afe6f35f75f6c130b29414371425e535c66.zip
FreeBSD-src-3c617afe6f35f75f6c130b29414371425e535c66.tar.gz
fix zfs set canmount=off on an unmounted filesystem
Previously this operation tried to unmount and remount children. Also see https://www.illumos.org/issues/6428. MFC after: 2 weeks X-Needs-Upstreaming: illumos
Diffstat (limited to 'cddl/contrib/opensolaris')
-rw-r--r--cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
index 504db96..4ed7c2b 100644
--- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
+++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
@@ -1633,8 +1633,9 @@ zfs_prop_set_list(zfs_handle_t *zhp, nvlist_t *props)
* its canmount property to 'on' or 'noauto'. We only use
* the changelist logic to unmount when setting canmount=off.
*/
- if (!(prop == ZFS_PROP_CANMOUNT &&
- fnvpair_value_uint64(elem) != ZFS_CANMOUNT_OFF)) {
+ if (prop != ZFS_PROP_CANMOUNT ||
+ (fnvpair_value_uint64(elem) == ZFS_CANMOUNT_OFF &&
+ zfs_is_mounted(zhp, NULL))) {
cls[cl_idx] = changelist_gather(zhp, prop, 0, 0);
if (cls[cl_idx] == NULL)
goto error;
OpenPOWER on IntegriCloud