]> git.baikalelectronics.ru Git - kernel.git/commit
block: deal with stale req count of plug list
authorMing Lei <ming.lei@canonical.com>
Wed, 16 Nov 2016 10:07:05 +0000 (18:07 +0800)
committerJens Axboe <axboe@fb.com>
Wed, 16 Nov 2016 15:09:51 +0000 (08:09 -0700)
commita91bd9be5733fbe39108c8cf253d25709564a1ec
treef965302c4a95854447b360d0d6c41dabfc28171e
parentd788508275143795b4e0679b6b1904576e6b9092
block: deal with stale req count of plug list

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: 5628da21cbe9f(blk-mq: immediately dispatch big size request)
Fixes: 6645b3ab947f5(block: immediately dispatch big size request)
Cc: Shaohua Li <shli@fb.com>
Signed-off-by: Ming Lei <ming.lei@canonical.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
block/blk-core.c
block/blk-mq.c