diff options
author | mm <mm@FreeBSD.org> | 2012-06-15 07:38:21 +0000 |
---|---|---|
committer | mm <mm@FreeBSD.org> | 2012-06-15 07:38:21 +0000 |
commit | 5e0236a3e4829ab4f9d2ec6afc10c63532d0fcf3 (patch) | |
tree | fcf8860b9c05e1e94b11fd87f4698305a3575375 /cddl | |
parent | 344306b2b3e50bddacb5c5ce1bc3b9f4fd8631ae (diff) | |
download | FreeBSD-src-5e0236a3e4829ab4f9d2ec6afc10c63532d0fcf3.zip FreeBSD-src-5e0236a3e4829ab4f9d2ec6afc10c63532d0fcf3.tar.gz |
Do not remount ZFS dataset if changing canmount property to "on" and
dataset is already mounted.
PR: 167905
Submitted by: Bryan Drewery <bryan@shatow.net>
MFC after: 1 week
Diffstat (limited to 'cddl')
-rw-r--r-- | cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c index fcd43a0..1d81f91 100644 --- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c +++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c @@ -1485,11 +1485,13 @@ 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. */ do_prefix = !((prop == ZFS_PROP_CANMOUNT) && (zprop_string_to_index(prop, propval, &idx, - ZFS_TYPE_DATASET) == 0) && (idx == ZFS_CANMOUNT_NOAUTO)); + ZFS_TYPE_DATASET) == 0) && (idx == ZFS_CANMOUNT_NOAUTO || + (idx == ZFS_CANMOUNT_ON && zfs_is_mounted(zhp, NULL)))); if (do_prefix && (ret = changelist_prefix(cl)) != 0) goto error; |