]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
blk-mq-tag: check for NULL rq when iterating tags
authorJens Axboe <axboe@kernel.dk>
Fri, 19 Jan 2018 12:43:12 +0000 (10:43 -0200)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 16 Feb 2018 17:40:11 +0000 (12:40 -0500)
commit346693fcb7a818e343127cf4cf950788f81d481a
tree1f51abbef9d2880e5d541535c2e75bd27104626b
parentdbe6e4678dffd29bd1a4b00dbe7544e584cf4afe
blk-mq-tag: check for NULL rq when iterating tags

BugLink: https://bugs.launchpad.net/bugs/1744300
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>
(cherry-pick from commit 7f5562d5ecc44c757599b201df928ba52fa05047)
Signed-off-by: Guilherme G. Piccoli <gpiccoli@canonical.com>
Acked-by: Kamal Mostafa <kamal@canonical.com>
Acked-by: Khalid Elmously <khalid.elmously@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
block/blk-mq-tag.c