mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 18:40:43 +03:00
Allow inherited properties in zfs_check_settable()
This change modifies how 'checksum' and 'dedup' properties are verified in zfs_check_settable() handling the case where they are explicitly inherited in the dataset hierarchy when receiving a recursive send stream. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Tom Caputi <tcaputi@datto.com> Signed-off-by: loli10K <ezomori.nozomu@gmail.com> Closes #7755 Closes #7576 Closes #7757
This commit is contained in:
+13
-13
@@ -4112,7 +4112,6 @@ zfs_check_settable(const char *dsname, nvpair_t *pair, cred_t *cr)
|
||||
{
|
||||
spa_feature_t feature;
|
||||
spa_t *spa;
|
||||
uint64_t intval;
|
||||
int err;
|
||||
|
||||
/* dedup feature version checks */
|
||||
@@ -4120,22 +4119,23 @@ zfs_check_settable(const char *dsname, nvpair_t *pair, cred_t *cr)
|
||||
zfs_earlier_version(dsname, SPA_VERSION_DEDUP))
|
||||
return (SET_ERROR(ENOTSUP));
|
||||
|
||||
if (nvpair_value_uint64(pair, &intval) != 0)
|
||||
return (SET_ERROR(EINVAL));
|
||||
if (nvpair_type(pair) == DATA_TYPE_UINT64 &&
|
||||
nvpair_value_uint64(pair, &intval) == 0) {
|
||||
/* check prop value is enabled in features */
|
||||
feature = zio_checksum_to_feature(
|
||||
intval & ZIO_CHECKSUM_MASK);
|
||||
if (feature == SPA_FEATURE_NONE)
|
||||
break;
|
||||
|
||||
/* check prop value is enabled in features */
|
||||
feature = zio_checksum_to_feature(intval & ZIO_CHECKSUM_MASK);
|
||||
if (feature == SPA_FEATURE_NONE)
|
||||
break;
|
||||
if ((err = spa_open(dsname, &spa, FTAG)) != 0)
|
||||
return (err);
|
||||
|
||||
if ((err = spa_open(dsname, &spa, FTAG)) != 0)
|
||||
return (err);
|
||||
|
||||
if (!spa_feature_is_enabled(spa, feature)) {
|
||||
if (!spa_feature_is_enabled(spa, feature)) {
|
||||
spa_close(spa, FTAG);
|
||||
return (SET_ERROR(ENOTSUP));
|
||||
}
|
||||
spa_close(spa, FTAG);
|
||||
return (SET_ERROR(ENOTSUP));
|
||||
}
|
||||
spa_close(spa, FTAG);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user