MFV r296522: 6541 Pool feature-flag check defeated if "verify" is included
in the dedup property value Reviewed by: Matthew Ahrens <mahrens@delphix.com> Reviewed by: Richard Laager <rlaager@wiktel.com> Approved by: Robert Mustacchi <rm@joyent.com> Author: ilovezfs <ilovezfs@icloud.com> illumos/illumos-gate@971640e6aa
This commit is contained in:
commit
26802705d3
@ -3973,7 +3973,7 @@ zfs_check_settable(const char *dsname, nvpair_t *pair, cred_t *cr)
|
||||
return (SET_ERROR(EINVAL));
|
||||
|
||||
/* check prop value is enabled in features */
|
||||
feature = zio_checksum_to_feature(intval);
|
||||
feature = zio_checksum_to_feature(intval & ZIO_CHECKSUM_MASK);
|
||||
if (feature == SPA_FEATURE_NONE)
|
||||
break;
|
||||
|
||||
|
@ -138,10 +138,16 @@ zio_checksum_info_t zio_checksum_table[ZIO_CHECKSUM_FUNCTIONS] = {
|
||||
#endif
|
||||
};
|
||||
|
||||
/*
|
||||
* The flag corresponding to the "verify" in dedup=[checksum,]verify
|
||||
* must be cleared first, so callers should use ZIO_CHECKSUM_MASK.
|
||||
*/
|
||||
spa_feature_t
|
||||
zio_checksum_to_feature(enum zio_checksum cksum)
|
||||
{
|
||||
#ifdef illumos
|
||||
VERIFY((cksum & ~ZIO_CHECKSUM_MASK) == 0);
|
||||
|
||||
switch (cksum) {
|
||||
case ZIO_CHECKSUM_SHA512:
|
||||
return (SPA_FEATURE_SHA512);
|
||||
|
Loading…
Reference in New Issue
Block a user