]> git.baikalelectronics.ru Git - kernel.git/commit
block: clear ctx pending bit under ctx lock
authorOmar Sandoval <osandov@fb.com>
Wed, 28 Feb 2018 00:56:42 +0000 (16:56 -0800)
committerJens Axboe <axboe@kernel.dk>
Wed, 28 Feb 2018 19:23:35 +0000 (12:23 -0700)
commitb2ce357c3e7fbc14a059e744537a01a54488a725
treed23b4989804cd48bb248142f9fa6370bd2700a2c
parentddf770a83cf7e7aa4b46bf2ef11e598e60b360b6
block: clear ctx pending bit under ctx lock

When we insert a request, we set the software queue pending bit while
holding the software queue lock. However, we clear it outside of the
lock, so it's possible that a concurrent insert could reset the bit
after we clear it but before we empty the request list. Afterwards, the
bit would still be set but the software queue wouldn't have any requests
in it, leading us to do a spurious run in the future. This is mostly a
benign/theoretical issue, but it makes the following change easier to
justify.

Signed-off-by: Omar Sandoval <osandov@fb.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-mq.c