blk-mq: bitmap tag: fix races on shared ::wake_index fields

Fix racy updates of shared blk_mq_bitmap_tags::wake_index
and blk_mq_hw_ctx::wake_index fields.

Cc: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
This commit is contained in:
Alexander Gordeev 2014-06-17 22:12:35 -07:00 • committed by Jens Axboe
commit 8537b12034
3 changed files with 23 additions and 13 deletions

View file

@ -42,7 +42,7 @@ struct blk_mq_hw_ctx {
unsigned int nr_ctx;
struct blk_mq_ctx **ctxs;
unsigned int wait_index;
atomic_t wait_index;
struct blk_mq_tags *tags;