Deleted Added
full compact
zfs_ioctl.c (289362) zfs_ioctl.c (289422)
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

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

183#include <sys/zvol.h>
184#include <sys/dsl_scan.h>
185#include <sys/dmu_objset.h>
186#include <sys/dmu_send.h>
187#include <sys/dsl_destroy.h>
188#include <sys/dsl_bookmark.h>
189#include <sys/dsl_userhold.h>
190#include <sys/zfeature.h>
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

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

183#include <sys/zvol.h>
184#include <sys/dsl_scan.h>
185#include <sys/dmu_objset.h>
186#include <sys/dmu_send.h>
187#include <sys/dsl_destroy.h>
188#include <sys/dsl_bookmark.h>
189#include <sys/dsl_userhold.h>
190#include <sys/zfeature.h>
191#include <sys/zio_checksum.h>
191
192#include "zfs_namecheck.h"
193#include "zfs_prop.h"
194#include "zfs_deleg.h"
195#include "zfs_comutil.h"
196#include "zfs_ioctl_compat.h"
197
198CTASSERT(sizeof(zfs_cmd_t) < IOCPARM_MAX);

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

3898 }
3899 break;
3900
3901 case ZFS_PROP_COPIES:
3902 if (zfs_earlier_version(dsname, SPA_VERSION_DITTO_BLOCKS))
3903 return (SET_ERROR(ENOTSUP));
3904 break;
3905
192
193#include "zfs_namecheck.h"
194#include "zfs_prop.h"
195#include "zfs_deleg.h"
196#include "zfs_comutil.h"
197#include "zfs_ioctl_compat.h"
198
199CTASSERT(sizeof(zfs_cmd_t) < IOCPARM_MAX);

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

3899 }
3900 break;
3901
3902 case ZFS_PROP_COPIES:
3903 if (zfs_earlier_version(dsname, SPA_VERSION_DITTO_BLOCKS))
3904 return (SET_ERROR(ENOTSUP));
3905 break;
3906
3906 case ZFS_PROP_DEDUP:
3907 if (zfs_earlier_version(dsname, SPA_VERSION_DEDUP))
3908 return (SET_ERROR(ENOTSUP));
3909 break;
3910
3911 case ZFS_PROP_RECORDSIZE:
3912 /* Record sizes above 128k need the feature to be enabled */
3913 if (nvpair_value_uint64(pair, &intval) == 0 &&
3914 intval > SPA_OLD_MAXBLOCKSIZE) {
3915 spa_t *spa;
3916
3917 /*
3918 * If this is a bootable dataset then

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

3953 if (nvpair_type(pair) == DATA_TYPE_UINT64 &&
3954 nvpair_value_uint64(pair, &intval) == 0) {
3955 if (intval == ZFS_ACL_PASSTHROUGH_X &&
3956 zfs_earlier_version(dsname,
3957 SPA_VERSION_PASSTHROUGH_X))
3958 return (SET_ERROR(ENOTSUP));
3959 }
3960 break;
3907 case ZFS_PROP_RECORDSIZE:
3908 /* Record sizes above 128k need the feature to be enabled */
3909 if (nvpair_value_uint64(pair, &intval) == 0 &&
3910 intval > SPA_OLD_MAXBLOCKSIZE) {
3911 spa_t *spa;
3912
3913 /*
3914 * If this is a bootable dataset then

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

3949 if (nvpair_type(pair) == DATA_TYPE_UINT64 &&
3950 nvpair_value_uint64(pair, &intval) == 0) {
3951 if (intval == ZFS_ACL_PASSTHROUGH_X &&
3952 zfs_earlier_version(dsname,
3953 SPA_VERSION_PASSTHROUGH_X))
3954 return (SET_ERROR(ENOTSUP));
3955 }
3956 break;
3957
3958 case ZFS_PROP_CHECKSUM:
3959 case ZFS_PROP_DEDUP:
3960 {
3961 spa_feature_t feature;
3962 spa_t *spa;
3963
3964 /* dedup feature version checks */
3965 if (prop == ZFS_PROP_DEDUP &&
3966 zfs_earlier_version(dsname, SPA_VERSION_DEDUP))
3967 return (SET_ERROR(ENOTSUP));
3968
3969 if (nvpair_value_uint64(pair, &intval) != 0)
3970 return (SET_ERROR(EINVAL));
3971
3972 /* check prop value is enabled in features */
3973 feature = zio_checksum_to_feature(intval);
3974 if (feature == SPA_FEATURE_NONE)
3975 break;
3976
3977 if ((err = spa_open(dsname, &spa, FTAG)) != 0)
3978 return (err);
3979 /*
3980 * Salted checksums are not supported on root pools.
3981 */
3982 if (spa_bootfs(spa) != 0 &&
3983 intval < ZIO_CHECKSUM_FUNCTIONS &&
3984 (zio_checksum_table[intval].ci_flags &
3985 ZCHECKSUM_FLAG_SALTED)) {
3986 spa_close(spa, FTAG);
3987 return (SET_ERROR(ERANGE));
3988 }
3989 if (!spa_feature_is_enabled(spa, feature)) {
3990 spa_close(spa, FTAG);
3991 return (SET_ERROR(ENOTSUP));
3992 }
3993 spa_close(spa, FTAG);
3994 break;
3961 }
3995 }
3996 }
3962
3963 return (zfs_secpolicy_setprop(dsname, prop, pair, CRED()));
3964}
3965
3966/*
3967 * Checks for a race condition to make sure we don't increment a feature flag
3968 * multiple times.
3969 */

--- 2680 unchanged lines hidden ---
3997
3998 return (zfs_secpolicy_setprop(dsname, prop, pair, CRED()));
3999}
4000
4001/*
4002 * Checks for a race condition to make sure we don't increment a feature flag
4003 * multiple times.
4004 */

--- 2680 unchanged lines hidden ---