diff options
author | mm <mm@FreeBSD.org> | 2012-07-12 06:29:54 +0000 |
---|---|---|
committer | mm <mm@FreeBSD.org> | 2012-07-12 06:29:54 +0000 |
commit | b81339c49fe432e4ae0491f78927e0ed39b6b106 (patch) | |
tree | 99d49e2c666540a88c0b3e654ad89f39d7f75614 /cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c | |
parent | d3c013c5a4ae3ebfa72239fe3050dada9f11d80f (diff) | |
download | FreeBSD-src-b81339c49fe432e4ae0491f78927e0ed39b6b106.zip FreeBSD-src-b81339c49fe432e4ae0491f78927e0ed39b6b106.tar.gz |
Change behavior introduced in r237119 to vendor solution
References:
https://www.illumos.org/issues/2883
PR: 167905
Obtained from: illumos (issue #2883)
MFC after: 2 weeks
Diffstat (limited to 'cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c')
-rw-r--r-- | cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c index 1d81f91..895475a 100644 --- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c +++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c @@ -1484,14 +1484,17 @@ zfs_prop_set(zfs_handle_t *zhp, const char *propname, const char *propval) } /* - * If the dataset's canmount property is being set to noauto, - * or being set to on and the dataset is already mounted, - * then we want to prevent unmounting & remounting it. + * 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. */ - do_prefix = !((prop == ZFS_PROP_CANMOUNT) && - (zprop_string_to_index(prop, propval, &idx, - ZFS_TYPE_DATASET) == 0) && (idx == ZFS_CANMOUNT_NOAUTO || - (idx == ZFS_CANMOUNT_ON && zfs_is_mounted(zhp, NULL)))); + if (prop == ZFS_PROP_CANMOUNT) { + uint64_t idx; + int err = zprop_string_to_index(prop, propval, &idx, + ZFS_TYPE_DATASET); + if (err == 0 && idx != ZFS_CANMOUNT_OFF) + do_prefix = B_FALSE; + } if (do_prefix && (ret = changelist_prefix(cl)) != 0) goto error; |