-
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 allocation error, detected using ASAN #10193
Conversation
Forgot to add this. Configuration: Error messages (somewhat edited):
|
Signed-off-by: João Carlos Mendes Luis <[email protected]>
Thanks for noticing this! |
Codecov Report
@@ Coverage Diff @@
## master #10193 +/- ##
==========================================
- Coverage 79.30% 79.21% -0.10%
==========================================
Files 387 387
Lines 123387 123388 +1
==========================================
- Hits 97858 97739 -119
- Misses 25529 25649 +120
Continue to review full report at Codecov.
|
The test for VDEV_TYPE_INDIRECT is done after a memory allocation, and could return from function without freeing it. Since we don't need that alocation yet, just postpone it. Signed-off-by: João Carlos Mendes Luís <[email protected]>
I'm new to this merge and update method from github, sorry if I did something wrong. Just added another leak fix, at f22b88f Error appears at
|
The test for VDEV_TYPE_INDIRECT is done after a memory allocation, and could return from function without freeing it. Since we don't need that allocation yet, just postpone it. Add a missing free() when buffer is no longer needed. Reviewed-by: Matthew Ahrens <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: João Carlos Mendes Luís <[email protected]> Closes openzfs#10193 (cherry picked from commit 75c6201)
The test for VDEV_TYPE_INDIRECT is done after a memory allocation, and could return from function without freeing it. Since we don't need that allocation yet, just postpone it. Add a missing free() when buffer is no longer needed. Reviewed-by: Matthew Ahrens <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: João Carlos Mendes Luís <[email protected]> Closes openzfs#10193 (cherry picked from commit 75c6201)
The test for VDEV_TYPE_INDIRECT is done after a memory allocation, and could return from function without freeing it. Since we don't need that allocation yet, just postpone it. Add a missing free() when buffer is no longer needed. Reviewed-by: Matthew Ahrens <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: João Carlos Mendes Luís <[email protected]> Closes openzfs#10193
Motivation and Context
I just found an ASAN warning in zpool cmd
Apparently it only turns on when a pool has some removed vdev data.
Description
Just add the
free()
when buffer is no more needed.How Has This Been Tested?
Compiled in my home setup, ran, and error is gone
Types of changes
Checklist:
Signed-off-by
.