summaryrefslogtreecommitdiffstats
path: root/include/sys
diff options
context:
space:
mode:
authorNed Bass <[email protected]>2015-04-23 12:32:59 -0700
committerBrian Behlendorf <[email protected]>2015-04-24 15:04:43 -0700
commit4eb30c68644c0aacbed9e10d94eff071b2cd76f8 (patch)
tree751fecec325462a50cf9739a87d384f757e90b0e /include/sys
parent7008109646446a3f9dda36bfbd3a526f4f8810ae (diff)
Serialize access to spa->spa_feat_stats nvlist
The function spa_add_feature_stats() manipulates the shared nvlist spa->spa_feat_stats in an unsafe concurrent manner. Add a mutex to protect the list. Signed-off-by: Ned Bass <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #3335
Diffstat (limited to 'include/sys')
-rw-r--r--include/sys/spa_impl.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/sys/spa_impl.h b/include/sys/spa_impl.h
index 72e04e8cf..19ba11537 100644
--- a/include/sys/spa_impl.h
+++ b/include/sys/spa_impl.h
@@ -236,6 +236,7 @@ struct spa {
uint64_t spa_feat_for_read_obj; /* required to read from pool */
uint64_t spa_feat_desc_obj; /* Feature descriptions */
uint64_t spa_feat_enabled_txg_obj; /* Feature enabled txg */
+ kmutex_t spa_feat_stats_lock; /* protects spa_feat_stats */
nvlist_t *spa_feat_stats; /* Cache of enabled features */
/* cache feature refcounts */
uint64_t spa_feat_refcount_cache[SPA_FEATURES];