Author: mm
Date: Thu Jul 12 06:29:54 2012
New Revision: 238391
URL: http://svn.freebsd.org/changeset/base/238391

Log:
  Change behavior introduced in r237119 to vendor solution
  
  References:
  https://www.illumos.org/issues/2883
  
  PR:           167905
  Obtained from:        illumos (issue #2883)
  MFC after:    2 weeks

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    Thu Jul 
12 04:23:11 2012        (r238390)
+++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c    Thu Jul 
12 06:29:54 2012        (r238391)
@@ -1484,14 +1484,17 @@ zfs_prop_set(zfs_handle_t *zhp, const ch
        }
 
        /*
-        * 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 ||
-           (idx == ZFS_CANMOUNT_ON && zfs_is_mounted(zhp, NULL))));
+        * We don't want to unmount & remount the dataset when changing
+        * its canmount property to 'on' or 'noauto'.  We only use
+        * the changelist logic to unmount when setting canmount=off.
+        */
+       if (prop == ZFS_PROP_CANMOUNT) {
+               uint64_t idx;
+               int err = zprop_string_to_index(prop, propval, &idx,
+                   ZFS_TYPE_DATASET);
+               if (err == 0 && idx != ZFS_CANMOUNT_OFF)
+                       do_prefix = B_FALSE;
+       }
 
        if (do_prefix && (ret = changelist_prefix(cl)) != 0)
                goto error;
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to