Skip to content

dmu_redact.c does not call bqueue_destroy #12118

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

Merged
merged 1 commit into from
Jul 20, 2021

Conversation

lundman
Copy link
Contributor

@lundman lundman commented May 25, 2021

Signed-off-by: Jorgen Lundman [email protected]

Ensure all calls to bqueue_init() has a corresponding call to bqueue_destroy().

Sorry about the new PR, after deforking there was no way to make the old PR see new commits.

Motivation and Context

Leaking resources, avoiding panics.

Description

Weirdest fluke of things here, the bqueue structure would not call bqueue_destroy() which means the mutex members inside are never mutex_destroy()ed either. Memory is freed and later on re-used, in my case, but entirely unrelated memory, however, by chance the new memory use happened to have a mutex in the same offset, and would then panic due to mutex already initialised.

I had to guess a bit on the locations of the bqueue_destroy() calls, so hopefully I got it right.

How Has This Been Tested?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

@behlendorf behlendorf added the Status: Revision Needed Changes are required for the PR to be accepted label May 26, 2021
@lundman lundman marked this pull request as ready for review May 26, 2021 01:10
@behlendorf behlendorf requested a review from pcd1193182 May 26, 2021 05:26
@behlendorf behlendorf added Status: Code Review Needed Ready for review and testing and removed Status: Revision Needed Changes are required for the PR to be accepted labels May 26, 2021
@lundman
Copy link
Contributor Author

lundman commented Jun 29, 2021

Ah sorry, when I used your suggestion in GH, it added a commit without Signed-off-by. Totally missed it :)

Co-authored-by: Brian Behlendorf <[email protected]>
Signed-off-by: Jorgen Lundman <[email protected]>
@behlendorf
Copy link
Contributor

@pcd1193182 would you mind reviewing this small change.

@mmaybee mmaybee added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Jul 20, 2021
@mmaybee mmaybee merged commit e042100 into openzfs:master Jul 20, 2021
behlendorf added a commit to behlendorf/zfs that referenced this pull request Aug 23, 2021
Ensure all calls to bqueue_init() has a corresponding call to bqueue_destroy()

Reviewed-by: Paul Dagnelie <[email protected]>
Co-authored-by: Brian Behlendorf <[email protected]>
Signed-off-by: Jorgen Lundman <[email protected]>
Closes openzfs#12118
behlendorf added a commit to behlendorf/zfs that referenced this pull request Aug 24, 2021
Ensure all calls to bqueue_init() has a corresponding call to bqueue_destroy()

Reviewed-by: Paul Dagnelie <[email protected]>
Co-authored-by: Brian Behlendorf <[email protected]>
Signed-off-by: Jorgen Lundman <[email protected]>
Closes openzfs#12118
behlendorf added a commit to behlendorf/zfs that referenced this pull request Aug 24, 2021
Ensure all calls to bqueue_init() has a corresponding call to bqueue_destroy()

Reviewed-by: Paul Dagnelie <[email protected]>
Co-authored-by: Brian Behlendorf <[email protected]>
Signed-off-by: Jorgen Lundman <[email protected]>
Closes openzfs#12118
behlendorf added a commit to behlendorf/zfs that referenced this pull request Aug 24, 2021
Ensure all calls to bqueue_init() has a corresponding call to bqueue_destroy()

Reviewed-by: Paul Dagnelie <[email protected]>
Co-authored-by: Brian Behlendorf <[email protected]>
Signed-off-by: Jorgen Lundman <[email protected]>
Closes openzfs#12118
behlendorf added a commit that referenced this pull request Aug 31, 2021
Ensure all calls to bqueue_init() has a corresponding call to bqueue_destroy()

Reviewed-by: Paul Dagnelie <[email protected]>
Co-authored-by: Brian Behlendorf <[email protected]>
Signed-off-by: Jorgen Lundman <[email protected]>
Closes #12118
tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Sep 15, 2021
Ensure all calls to bqueue_init() has a corresponding call to bqueue_destroy()

Reviewed-by: Paul Dagnelie <[email protected]>
Co-authored-by: Brian Behlendorf <[email protected]>
Signed-off-by: Jorgen Lundman <[email protected]>
Closes openzfs#12118
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants