]> git.baikalelectronics.ru Git - kernel.git/commit
blkmq: Fix NULL pointer deref when all reserved tags in
authorSam Bradshaw <sbradshaw@micron.com>
Wed, 18 Mar 2015 23:06:18 +0000 (17:06 -0600)
committerJens Axboe <axboe@fb.com>
Wed, 18 Mar 2015 23:06:18 +0000 (17:06 -0600)
commitbab63cb0f8627a5b560efac6a3285a06dd4314d5
tree08dec19e40bccd2d87738686f94c15e31d121c67
parent03f78d066bf77f64102e9f64a1218b0132122d4c
blkmq: Fix NULL pointer deref when all reserved tags in

When allocating from the reserved tags pool, bt_get() is called with
a NULL hctx.  If all tags are in use, the hw queue is kicked to push
out any pending IO, potentially freeing tags, and tag allocation is
retried.  The problem is that blk_mq_run_hw_queue() doesn't check for
a NULL hctx.  So we avoid it with a simple NULL hctx test.

Tested by hammering mtip32xx with concurrent smartctl/hdparm.

Signed-off-by: Sam Bradshaw <sbradshaw@micron.com>
Signed-off-by: Selvan Mani <smani@micron.com>
Fixes: 16e17794265e ("blk-mq: fix hang in bt_get()")
Cc: stable@kernel.org
Added appropriate comment.

Signed-off-by: Jens Axboe <axboe@fb.com>
block/blk-mq-tag.c