From owner-svn-src-stable-11@freebsd.org Tue Sep 6 06:17:35 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A8B7BC749E; Tue, 6 Sep 2016 06:17:35 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A74C13A3; Tue, 6 Sep 2016 06:17:35 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u866HYQS087188; Tue, 6 Sep 2016 06:17:34 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u866HYH7087187; Tue, 6 Sep 2016 06:17:34 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201609060617.u866HYH7087187@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 6 Sep 2016 06:17:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305460 - stable/11/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Sep 2016 06:17:35 -0000 Author: avg Date: Tue Sep 6 06:17:34 2016 New Revision: 305460 URL: https://svnweb.freebsd.org/changeset/base/305460 Log: MFC r304520: fix bug introduced in r297521, set canmount=on doesn't mount filesystem Modified: stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Directory Properties: stable/11/ (props changed) Modified: stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Tue Sep 6 06:13:52 2016 (r305459) +++ stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Tue Sep 6 06:17:34 2016 (r305460) @@ -1630,12 +1630,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;