Deleted Added
full compact
libzfs_dataset.c (237119) libzfs_dataset.c (238391)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 1470 unchanged lines hidden (view full) ---

1479 zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
1480 "child dataset with inherited mountpoint is used "
1481 "in a non-global zone"));
1482 ret = zfs_error(hdl, EZFS_ZONED, errbuf);
1483 goto error;
1484 }
1485
1486 /*
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 1470 unchanged lines hidden (view full) ---

1479 zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
1480 "child dataset with inherited mountpoint is used "
1481 "in a non-global zone"));
1482 ret = zfs_error(hdl, EZFS_ZONED, errbuf);
1483 goto error;
1484 }
1485
1486 /*
1487 * If the dataset's canmount property is being set to noauto,
1488 * or being set to on and the dataset is already mounted,
1489 * then we want to prevent unmounting & remounting it.
1487 * We don't want to unmount & remount the dataset when changing
1488 * its canmount property to 'on' or 'noauto'. We only use
1489 * the changelist logic to unmount when setting canmount=off.
1490 */
1490 */
1491 do_prefix = !((prop == ZFS_PROP_CANMOUNT) &&
1492 (zprop_string_to_index(prop, propval, &idx,
1493 ZFS_TYPE_DATASET) == 0) && (idx == ZFS_CANMOUNT_NOAUTO ||
1494 (idx == ZFS_CANMOUNT_ON && zfs_is_mounted(zhp, NULL))));
1491 if (prop == ZFS_PROP_CANMOUNT) {
1492 uint64_t idx;
1493 int err = zprop_string_to_index(prop, propval, &idx,
1494 ZFS_TYPE_DATASET);
1495 if (err == 0 && idx != ZFS_CANMOUNT_OFF)
1496 do_prefix = B_FALSE;
1497 }
1495
1496 if (do_prefix && (ret = changelist_prefix(cl)) != 0)
1497 goto error;
1498
1499 /*
1500 * Execute the corresponding ioctl() to set this property.
1501 */
1502 (void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name));

--- 2970 unchanged lines hidden ---
1498
1499 if (do_prefix && (ret = changelist_prefix(cl)) != 0)
1500 goto error;
1501
1502 /*
1503 * Execute the corresponding ioctl() to set this property.
1504 */
1505 (void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name));

--- 2970 unchanged lines hidden ---