Author: avg
Date: Tue Apr 19 12:20:28 2016
New Revision: 298266
URL: https://svnweb.freebsd.org/changeset/base/298266

Log:
  MFC r297521: fix zfs set canmount=off on an unmounted filesystem
  
  No MFC to stable/9 because of a non-trivial merge conflict and no
  way to test the edited code.

Modified:
  stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
==============================================================================
--- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c       
Tue Apr 19 12:14:52 2016        (r298265)
+++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c       
Tue Apr 19 12:20:28 2016        (r298266)
@@ -1627,8 +1627,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;
_______________________________________________
svn-src-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-unsubscr...@freebsd.org"

Reply via email to