blk-mq-tag: check for NULL rq when iterating tags
authorJens Axboe <axboe@kernel.dk>
Fri, 4 Aug 2017 19:37:03 +0000 (13:37 -0600)
committerJens Axboe <axboe@kernel.dk>
Tue, 8 Aug 2017 23:48:40 +0000 (17:48 -0600)
commit84959dd2731966c06dea3fed71666d653ed6e0c6
tree6d60b08276d17a5b09c552bb6cba0243582d5bc4
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.

Reviewed-by: Bart Van Assche <bart.vanassche@wdc.com>
Reviewed-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-mq-tag.c