blk-mq-tag: check for NULL rq when iterating tags
authorJens Axboe <axboe@kernel.dk>
Sat, 1 Jul 2017 03:33:10 +0000 (21:33 -0600)
committerJens Axboe <axboe@kernel.dk>
Thu, 3 Aug 2017 20:39:21 +0000 (14:39 -0600)
commit1908e43118e688e41ac8656edcf3e7a150f3f508
treedd29e90add317eb00f3ec9d2d3a7adafecdf3645
parentb01d38e9f5a384c289aa3761b62c8b3f73570c31
blk-mq-tag: check for NULL rq when iterating tags

Since we introduced blk-mq-sched, the tags->rqs[] array has been
dynamically assigned. So we need to check for NULL when iterating,
since there's a window of time where the bit is set, but we haven't
dynamically assigned the tags->rqs[] array position yet.

This is perfectly safe, since the memory backing of the request is
never going away while the device is alive.

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