Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Apr 2016 12:20:29 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r298266 - stable/10/cddl/contrib/opensolaris/lib/libzfs/common
Message-ID:  <201604191220.u3JCKTjZ086217@repo.freebsd.org>

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



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