diff options
author | Ming Lei <[email protected]> | 2021-05-11 23:22:35 +0800 |
---|---|---|
committer | Jens Axboe <[email protected]> | 2021-05-24 06:47:22 -0600 |
commit | bd63141d585bef14f4caf111f6d0e27fe2300ec6 (patch) | |
tree | 18c509a0a1fb0b90746396b360a5b1e5b46bae37 /scripts/gdb/linux/tasks.py | |
parent | 2e315dc07df009c3e29d6926871f62a30cfae394 (diff) |
blk-mq: clear stale request in tags->rq[] before freeing one request pool
refcount_inc_not_zero() in bt_tags_iter() still may read one freed
request.
Fix the issue by the following approach:
1) hold a per-tags spinlock when reading ->rqs[tag] and calling
refcount_inc_not_zero in bt_tags_iter()
2) clearing stale request referred via ->rqs[tag] before freeing
request pool, the per-tags spinlock is held for clearing stale
->rq[tag]
So after we cleared stale requests, bt_tags_iter() won't observe
freed request any more, also the clearing will wait for pending
request reference.
The idea of clearing ->rqs[] is borrowed from John Garry's previous
patch and one recent David's patch.
Tested-by: John Garry <[email protected]>
Reviewed-by: David Jeffery <[email protected]>
Reviewed-by: Bart Van Assche <[email protected]>
Signed-off-by: Ming Lei <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jens Axboe <[email protected]>
Diffstat (limited to 'scripts/gdb/linux/tasks.py')
0 files changed, 0 insertions, 0 deletions