• Bart Van Assche's avatar
    blk-mq: Avoid that __bt_get_word() wraps multiple times · 9e98e9d7
    Bart Van Assche authored
    If __bt_get_word() is called with last_tag != 0, if the first
    find_next_zero_bit() fails, if after wrap-around the
    test_and_set_bit() call fails and find_next_zero_bit() succeeds,
    if the next test_and_set_bit() call fails and subsequently
    find_next_zero_bit() does not find a zero bit, then another
    wrap-around will occur. Avoid this by introducing an additional
    local variable.
    Signed-off-by: default avatarBart Van Assche <bvanassche@acm.org>
    Cc: Christoph Hellwig <hch@lst.de>
    Cc: Robert Elliott <elliott@hp.com>
    Cc: Ming Lei <ming.lei@canonical.com>
    Cc: Alexander Gordeev <agordeev@redhat.com>
    Cc: <stable@vger.kernel.org> # v3.13+
    Signed-off-by: default avatarJens Axboe <axboe@fb.com>
    9e98e9d7
blk-mq-tag.c 13.8 KB