summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authorAndriy Gapon <andriy.gapon@clusterhq.com>2016-11-21 15:29:36 -0800
committerMatthew Ahrens <mahrens@delphix.com>2016-11-21 16:11:45 -0800
commitc079fa4d202eff15e318131c52755d214ffa2da7 (patch)
tree2cf1fbb4a888a8b59e0a5d3050a6a02d898c5a2e /usr/src
parentbfaed0b91e57062c38bc16b4f89db3c8f0052a9b (diff)
downloadillumos-joyent-c079fa4d202eff15e318131c52755d214ffa2da7.tar.gz
6428 set canmount=off on unmounted filesystem tries to unmount children
Reviewed by: Matthew Ahrens <mahrens@delphix.com> Approved by: Gordon Ross <gordon.w.ross@gmail.com>
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/lib/libzfs/common/libzfs_dataset.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr/src/lib/libzfs/common/libzfs_dataset.c b/usr/src/lib/libzfs/common/libzfs_dataset.c
index 4200f49cca..32a8dbf682 100644
--- a/usr/src/lib/libzfs/common/libzfs_dataset.c
+++ b/usr/src/lib/libzfs/common/libzfs_dataset.c
@@ -1689,8 +1689,9 @@ zfs_prop_set_list(zfs_handle_t *zhp, nvlist_t *props)
* 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;