blkmq: Fix NULL pointer deref when all reserved tags in v3.10-blk-mq
authorSam Bradshaw <sbradshaw@micron.com>
Wed, 18 Mar 2015 23:06:18 +0000 (17:06 -0600)
committerJens Axboe <axboe@fb.com>
Mon, 30 Mar 2015 18:54:58 +0000 (12:54 -0600)
commit343a6c212de4e0b445d8b3b7882066d2f5e37135
tree1f05fc38f2a8ea81448f34c87fd8f8ed8a9c48df
parent9dc7acf1f18942fef5d12bc4a2fd52913a86ec2d
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: b32232073e80 ("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