Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Jul 2012 06:29:55 +0000 (UTC)
From:      Martin Matuska <mm@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r238391 - head/cddl/contrib/opensolaris/lib/libzfs/common
Message-ID:  <201207120629.q6C6TtOa090337@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201207120629.q6C6TtOa090337>