From 9598fc63e6ff264b11437c546e9e9afcd6492901 Mon Sep 17 00:00:00 2001 From: Allan Jude Date: Fri, 19 Jun 2020 17:59:55 +0000 Subject: [PATCH] ZFS: Allow setting checksum=skein on boot pools PR: 245889 Reported by: delphij Sponsored by: Klara Inc. --- cddl/contrib/opensolaris/cmd/zfs/zfs.8 | 6 +++--- cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 | 3 +++ .../contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c | 11 +---------- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/cddl/contrib/opensolaris/cmd/zfs/zfs.8 b/cddl/contrib/opensolaris/cmd/zfs/zfs.8 index 999e10211bbe..33e0ca4b3040 100644 --- a/cddl/contrib/opensolaris/cmd/zfs/zfs.8 +++ b/cddl/contrib/opensolaris/cmd/zfs/zfs.8 @@ -1001,9 +1001,9 @@ for more information on these algorithms. .Pp Changing this property affects only newly-written data. .Pp -Salted checksum algorithms -.Pq Cm edonr , skein -are currently not supported for any filesystem on the boot pools. +The salted checksum algorithm +.Pq Cm edonr +is currently not supported on FreeBSD. .It Sy compression Ns = Ns Cm on | off | lzjb | gzip | gzip- Ns Ar N | Cm zle | Cm lz4 Controls the compression algorithm used for this dataset. Setting compression to diff --git a/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 b/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 index b40bf9b5b1c7..6fe0c18d4759 100644 --- a/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 +++ b/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 @@ -632,6 +632,9 @@ and will return to being once all filesystems that have ever had their checksum set to .Sy skein are destroyed. +Booting off of pools using +.Sy skein +is supported. .It Sy allocation_classes .Bl -column "READ\-ONLY COMPATIBLE" "com.intel:allocation_classes" .It GUID Ta com.intel:allocation_classes diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c index c84e6a207753..9cdc77b72024 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c @@ -4373,16 +4373,7 @@ zfs_check_settable(const char *dsname, nvpair_t *pair, cred_t *cr) if ((err = spa_open(dsname, &spa, FTAG)) != 0) return (err); - /* - * Salted checksums are not supported on root pools. - */ - if (spa_bootfs(spa) != 0 && - intval < ZIO_CHECKSUM_FUNCTIONS && - (zio_checksum_table[intval].ci_flags & - ZCHECKSUM_FLAG_SALTED)) { - spa_close(spa, FTAG); - return (SET_ERROR(ERANGE)); - } + if (!spa_feature_is_enabled(spa, feature)) { spa_close(spa, FTAG); return (SET_ERROR(ENOTSUP));