diff options
author | George Melikov <[email protected]> | 2017-01-23 22:13:15 +0300 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2017-01-23 11:13:15 -0800 |
commit | b87baa7ed2374bf8138f2c9f6b260498c0252eb6 (patch) | |
tree | aecfd35f2156bfb9edd432b94574ecbf046c0894 /lib/libzfs | |
parent | ec923db25c823dd460fdb5db44a5a202a0975f27 (diff) |
OpenZFS 6428 - set canmount=off on unmounted filesystem tries to unmount children
Authored by: Andriy Gapon <[email protected]>
Reviewed by: Matthew Ahrens <[email protected]>
Approved by: Gordon Ross <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Giuseppe Di Natale <[email protected]>
Ported-by: George Melikov <[email protected]>
OpenZFS-issue: https://www.illumos.org/issues/6428
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/c079fa4
Closes #5628
Diffstat (limited to 'lib/libzfs')
-rw-r--r-- | lib/libzfs/libzfs_dataset.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libzfs/libzfs_dataset.c b/lib/libzfs/libzfs_dataset.c index d4f016660..240728f96 100644 --- a/lib/libzfs/libzfs_dataset.c +++ b/lib/libzfs/libzfs_dataset.c @@ -1628,8 +1628,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; |