Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 Sep 2016 06:17:39 +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: r305461 - stable/10/cddl/contrib/opensolaris/lib/libzfs/common
Message-ID:  <201609060617.u866HdTv087236@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avg
Date: Tue Sep  6 06:17:39 2016
New Revision: 305461
URL: https://svnweb.freebsd.org/changeset/base/305461

Log:
  MFC r304520: fix bug introduced in r297521, set canmount=on doesn't
  mount filesystem

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 Sep  6 06:17:34 2016	(r305460)
+++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c	Tue Sep  6 06:17:39 2016	(r305461)
@@ -1624,12 +1624,17 @@ zfs_prop_set_list(zfs_handle_t *zhp, nvl
 		assert(cl_idx < nvl_len);
 		/*
 		 * 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.
+		 * its canmount property.  We only use the changelist logic to
+		 * unmount when setting canmount=off for a mounted filesystem
+		 * or when setting canmount=on for an unmounted filesystem.
+		 * For all other changes to canmount property the filesystem
+		 * remains the same.
 		 */
 		if (prop != ZFS_PROP_CANMOUNT ||
 		    (fnvpair_value_uint64(elem) == ZFS_CANMOUNT_OFF &&
-		     zfs_is_mounted(zhp, NULL))) {
+		     zfs_is_mounted(zhp, NULL)) ||
+		    (fnvpair_value_uint64(elem) == ZFS_CANMOUNT_ON &&
+		     !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?201609060617.u866HdTv087236>