• Alexander Gordeev's avatar
    blk-mq: bitmap tag: fix races in bt_get() function · 86fb5c56
    Alexander Gordeev authored
    This update fixes few issues in bt_get() function:
    
    - list_empty(&wait.task_list) check is not protected;
    
    - was_empty check is always true which results in *every* thread
      entering the loop resets bt_wait_state::wait_cnt counter rather
      than every bt->wake_cnt'th thread;
    
    - 'bt_wait_state::wait_cnt' counter update is redundant, since
      it also gets reset in bt_clear_tag() function;
    
    Cc: Christoph Hellwig <hch@infradead.org>
    Cc: Ming Lei <tom.leiming@gmail.com>
    Cc: Jens Axboe <axboe@kernel.dk>
    Signed-off-by: default avatarAlexander Gordeev <agordeev@redhat.com>
    Signed-off-by: default avatarJens Axboe <axboe@fb.com>
    86fb5c56
blk-mq-tag.c 13.7 KB