diff options
author | Andriy Gapon <andriy.gapon@clusterhq.com> | 2016-11-21 15:29:36 -0800 |
---|---|---|
committer | Matthew Ahrens <mahrens@delphix.com> | 2016-11-21 16:11:45 -0800 |
commit | c079fa4d202eff15e318131c52755d214ffa2da7 (patch) | |
tree | 2cf1fbb4a888a8b59e0a5d3050a6a02d898c5a2e /usr/src | |
parent | bfaed0b91e57062c38bc16b4f89db3c8f0052a9b (diff) | |
download | illumos-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.c | 5 |
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; |