-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix hash_lock / keystore.sk_dk_lock lock inversion #7115
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. This solution is a lot better than the previous one.
module/zfs/dsl_crypt.c
Outdated
/* Lookup the key in the tree of currently loaded keys */ | ||
rw_enter(&spa->spa_keystore.sk_dk_lock, RW_READER); | ||
ret = spa_keystore_dsl_key_hold_impl(spa, dckobj, tag, &dck_ks); | ||
rw_exit(&spa->spa_keystore.sk_dk_lock); | ||
if (!ret) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably should change this to ret == 0 while we're here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do
The keystore.sk_dk_lock should not be held while performing I/O. Drop the lock when reading from disk and update the code so they the first successful caller adds the lock. Improve error handling in spa_keystore_create_mapping_impl(). Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> TEST_ZTEST_TIMEOUT=3600 Issue openzfs#7112
1cacf7d
to
b2d2ea0
Compare
@tcaputi I've refresh this can you look at it again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Codecov Report
@@ Coverage Diff @@
## master #7115 +/- ##
==========================================
- Coverage 75.43% 75.33% -0.11%
==========================================
Files 296 296
Lines 95912 95910 -2
==========================================
- Hits 72355 72253 -102
- Misses 23557 23657 +100
Continue to review full report at Codecov.
|
Zlooped for the last ~4h, no sudden death yet. |
is this going to be included in 0.7.6 release? |
Encryption is not going to be included at all until 0.8.0. |
The keystore.sk_dk_lock should not be held while performing I/O. Drop the lock when reading from disk and update the code so they the first successful caller adds the key. Improve error handling in spa_keystore_create_mapping_impl(). Reviewed by: Thomas Caputi <tcaputi@datto.com> Reviewed-by: RageLtMan <rageltman@sempervictus> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes openzfs#7112 Closes openzfs#7115
Description
The keystore.sk_dk_lock should not be held while performing I/O. Drop the lock when reading from disk and update the code so they the first successful caller adds the key.
Motivation and Context
#7112
How Has This Been Tested?
Locally built, overnight ztest run underway.
Types of changes
Checklist:
Signed-off-by
.