• Ming Lei's avatar
    block: deal with stale req count of plug list · 0a6219a9
    Ming Lei authored
    In both legacy and mq path, req count of plug list is computed
    before allocating request, so the number can be stale when falling
    back to slept allocation, also the new introduced wbt can sleep
    too.
    
    This patch deals with the case by checking if plug list becomes
    empty, and fixes the KASAN report of 'BUG: KASAN: stack-out-of-bounds'
    which is introduced by Shaohua's patches of dispatching big request.
    
    Fixes: 600271d9(blk-mq: immediately dispatch big size request)
    Fixes: 50d24c34(block: immediately dispatch big size request)
    Cc: Shaohua Li <shli@fb.com>
    Signed-off-by: default avatarMing Lei <ming.lei@canonical.com>
    Signed-off-by: default avatarJens Axboe <axboe@fb.com>
    0a6219a9
blk-mq.c 60.3 KB