Closed vincentkfu closed 1 month ago
IIRC, smalloc() used to always clear the allocated region, which is why scalloc() didn't do anything outside of that. Either my memory is wrong, or it just got lost down the line.
I think it was this:
commit 9c3e13e3314da394698ca32f21cc46d46b7cfe47
Author: Jens Axboe <axboe@fb.com>
Date: Sat Nov 7 17:33:38 2015 -0700
smalloc: only clear the bitmap, not the whole pool
Just add the memset() to calloc on successful alloc?
Edit: heh, I think you can just do:
$ git revert a640ed36829f3be6d9dd8c7974dba41b9b59e6a5
and be done with it.
Reverted. Thanks for the history!
This turned out not to be a bug:
https://git.kernel.dk/cgit/fio/commit/?id=f956fed4d181d41a5b1c49bba9dce46d8197d428
Should probably have a comment in there, since we've now done it, reverted it, and reverted the revert.
smalloc.c:scalloc()
is defined in this way:scalloc()
does not actually clear the buffer returned to the caller. I know of no reports of this actually causing problems but we should fix this.