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
This commit is contained in:
Martin Matuska 2012-06-15 07:38:21 +00:00
parent aa0c93a5ca
commit 153e430149
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=237119

View File

@ -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;