svn commit: r297521 - head/cddl/contrib/opensolaris/lib/libzfs/common
Andriy Gapon
avg at FreeBSD.org
Sun Apr 3 07:42:14 UTC 2016
Author: avg
Date: Sun Apr 3 07:42:13 2016
New Revision: 297521
URL: https://svnweb.freebsd.org/changeset/base/297521
Log:
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
Modified:
head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Sun Apr 3 07:40:33 2016 (r297520)
+++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Sun Apr 3 07:42:13 2016 (r297521)
@@ -1633,8 +1633,9 @@ zfs_prop_set_list(zfs_handle_t *zhp, nvl
* 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;
More information about the svn-src-head
mailing list