summaryrefslogtreecommitdiffstats
path: root/cddl/contrib
diff options
context:
space:
mode:
authoravg <avg@FreeBSD.org>2016-09-06 06:17:34 +0000
committeravg <avg@FreeBSD.org>2016-09-06 06:17:34 +0000
commit48aa9b4e1568863a3e118320ce0b22b39eb43d94 (patch)
treee7d58e96f07ca77491f15f379e0af46b04538ef7 /cddl/contrib
parentb2223ce8e9f8ed9a7f239ec1f7bb2cf3cb2591f8 (diff)
downloadFreeBSD-src-48aa9b4e1568863a3e118320ce0b22b39eb43d94.zip
FreeBSD-src-48aa9b4e1568863a3e118320ce0b22b39eb43d94.tar.gz
MFC r304520: fix bug introduced in r297521, set canmount=on doesn't
mount filesystem
Diffstat (limited to 'cddl/contrib')
-rw-r--r--cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
index dbafaa9..5babb7b31 100644
--- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
+++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
@@ -1630,12 +1630,17 @@ zfs_prop_set_list(zfs_handle_t *zhp, nvlist_t *props)
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;
OpenPOWER on IntegriCloud