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
This commit is contained in:
parent
7f6eecf580
commit
04cb23e3b1
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user