-
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 double mutex_init bug in send code #10374
Conversation
Ah neat - I was set to drill down further to try to figure out where it goes wrong, but a PR is even better :) |
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.
I can confirm this removes the panic during the zfs-tester run.
cheers,
Codecov Report
@@ Coverage Diff @@
## master #10374 +/- ##
==========================================
+ Coverage 79.30% 79.53% +0.23%
==========================================
Files 391 391
Lines 123603 123604 +1
==========================================
+ Hits 98018 98305 +287
+ Misses 25585 25299 -286
Continue to review full report at Codecov.
|
Looks good, would you just mind fixing the style warning and rebasing this on master.
|
@pcd1193182 I've love to get this merged if you can just address style issue and rebase. |
Signed-off-by: Paul Dagnelie <pcd@delphix.com>
It was possible to cause a kernel panic in the send code by initializing an already-initialized mutex, if a record was created with type DATA, destroyed with a different type (bypassing the mutex_destroy call) and then re-allocated as a DATA record again. We tweak the logic to not change the type of a record once it has been created, avoiding the issue. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Jorgen Lundman <lundman@lundman.net> Signed-off-by: Paul Dagnelie <pcd@delphix.com> Closes openzfs#10374 (cherry picked from commit 99b281f)
It was possible to cause a kernel panic in the send code by initializing an already-initialized mutex, if a record was created with type DATA, destroyed with a different type (bypassing the mutex_destroy call) and then re-allocated as a DATA record again. We tweak the logic to not change the type of a record once it has been created, avoiding the issue. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Jorgen Lundman <lundman@lundman.net> Signed-off-by: Paul Dagnelie <pcd@delphix.com> Closes openzfs#10374
Signed-off-by: Paul Dagnelie pcd@delphix.com
Motivation and Context
It was possible to cause a kernel panic in the send code by initializing an already-initialized mutex, if a record was created with type DATA, destroyed with a different type (bypassing the mutex_destroy call) and then re-allocated as a DATA record again.
Description
We tweak the logic to not change the type of a record once it has been created, avoiding the issue.
How Has This Been Tested?
Passes zfs test suite
Types of changes
Checklist:
Signed-off-by
.