aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndriy Gapon <avg@FreeBSD.org>2019-08-12 11:27:17 +0000
committerAndriy Gapon <avg@FreeBSD.org>2019-08-12 11:27:17 +0000
commitfeaa27590c679fea301c2c0f391cfa4b6f62e8fa (patch)
tree2e4cc0d6ec5b740132495877c15552d076ef578e
parentaa3ceb5baedc4e65cbde7a334ca6b82f0569b192 (diff)
downloadsrc-feaa27590c679fea301c2c0f391cfa4b6f62e8fa.tar.gz
src-feaa27590c679fea301c2c0f391cfa4b6f62e8fa.zip
6585 sha512, skein, and edonr have an unenforced dependency on extensible dataset
illumos/illumos-gate@892586e8a147c02d7f4053cc405229a13e796928 https://github.com/illumos/illumos-gate/commit/892586e8a147c02d7f4053cc405229a13e796928 https://www.illumos.org/issues/6585 In any pool without the extensible dataset feature flag already enabled, creating a dataset with dedup set to use one of the new checksums would result in the following panic as soon as any data was added: panic[cpu0]/thread=ffffff0006761c40: feature_get_refcount(spa, feature, &refcount) != 48 (0x30 != 0x30), file: ../../common/fs/zfs/zfeature.c line 390 ffffff0006761830 fffffffffba8fbdd () ffffff0006761890 zfs:feature_do_action+11a () ffffff00067618c0 zfs:spa_feature_incr+1e () ffffff0006761920 zfs:dmu_object_zapify+b7 () ffffff00067619b0 zfs:dsl_dataset_activate_feature+97 () ffffff0006761a20 zfs:dsl_dataset_sync+ba () ffffff0006761ab0 zfs:dsl_pool_sync+153 () ffffff0006761b70 zfs:spa_sync+26e () ffffff0006761c20 zfs:txg_sync_thread+227 () ffffff0006761c30 unix:thread_start+8 () Inspection showed that feature->fi_feature was 7, which is the value of SPA_FEATURE_EXTENSIBLE_DATASET in the spa_feature enum. Testing shows that the panic can be prevented by explicitly setting extensible dataset as a dependency for the sha512, edonr, and skein feature flags. Alternatively, the new checksums code could possibly be changed to obviate the need for the dependency. 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>
Notes
Notes: svn path=/vendor-sys/illumos/dist/; revision=350896
-rw-r--r--common/zfs/zfeature_common.c20
-rw-r--r--man/man5/zpool-features.56
2 files changed, 20 insertions, 6 deletions
diff --git a/common/zfs/zfeature_common.c b/common/zfs/zfeature_common.c
index 6fbc0fc974a8..07eb83a4d3e1 100644
--- a/common/zfs/zfeature_common.c
+++ b/common/zfs/zfeature_common.c
@@ -245,18 +245,32 @@ zpool_feature_init(void)
"Support for blocks larger than 128KB.",
ZFEATURE_FLAG_PER_DATASET, large_blocks_deps);
+ static const spa_feature_t sha512_deps[] = {
+ SPA_FEATURE_EXTENSIBLE_DATASET,
+ SPA_FEATURE_NONE
+ };
zfeature_register(SPA_FEATURE_SHA512,
"org.illumos:sha512", "sha512",
"SHA-512/256 hash algorithm.",
- ZFEATURE_FLAG_PER_DATASET, NULL);
+ ZFEATURE_FLAG_PER_DATASET, sha512_deps);
+
+ static const spa_feature_t skein_deps[] = {
+ SPA_FEATURE_EXTENSIBLE_DATASET,
+ SPA_FEATURE_NONE
+ };
zfeature_register(SPA_FEATURE_SKEIN,
"org.illumos:skein", "skein",
"Skein hash algorithm.",
- ZFEATURE_FLAG_PER_DATASET, NULL);
+ ZFEATURE_FLAG_PER_DATASET, skein_deps);
+
+ static const spa_feature_t edonr_deps[] = {
+ SPA_FEATURE_EXTENSIBLE_DATASET,
+ SPA_FEATURE_NONE
+ };
zfeature_register(SPA_FEATURE_EDONR,
"org.illumos:edonr", "edonr",
"Edon-R hash algorithm.",
- ZFEATURE_FLAG_PER_DATASET, NULL);
+ ZFEATURE_FLAG_PER_DATASET, edonr_deps);
zfeature_register(SPA_FEATURE_DEVICE_REMOVAL,
"com.delphix:device_removal", "device_removal",
diff --git a/man/man5/zpool-features.5 b/man/man5/zpool-features.5
index a2ba170b0756..c1b17354071a 100644
--- a/man/man5/zpool-features.5
+++ b/man/man5/zpool-features.5
@@ -543,7 +543,7 @@ filesystems that have ever had their recordsize larger than 128KB are destroyed.
l l .
GUID org.illumos:sha512
READ\-ONLY COMPATIBLE no
-DEPENDENCIES none
+DEPENDENCIES extensible_dataset
.TE
This feature enables the use of the SHA-512/256 truncated hash algorithm
@@ -575,7 +575,7 @@ Booting off of pools utilizing SHA-512/256 is supported.
l l .
GUID org.illumos:skein
READ\-ONLY COMPATIBLE no
-DEPENDENCIES none
+DEPENDENCIES extensible_dataset
.TE
This feature enables the use of the Skein hash algorithm for checksum
@@ -609,7 +609,7 @@ Booting off of pools using \fBskein\fR is supported.
l l .
GUID org.illumos:edonr
READ\-ONLY COMPATIBLE no
-DEPENDENCIES none
+DEPENDENCIES extensible_dataset
.TE
This feature enables the use of the Edon-R hash algorithm for checksum,