diff options
author | Dennis Zhou | 2018-12-12 00:03:08 +0100 |
---|---|---|
committer | Jens Axboe | 2018-12-13 01:43:33 +0100 |
commit | 0273ac349f08f4ff9ef88aaaf9c9f2aa6e87d2be (patch) | |
tree | 66eca0900055858fa5e9d34bf8ae3b867a945ee7 /drivers/net/wireless | |
parent | block: deactivate blk_stat timer in wbt_disable_default() (diff) | |
download | kernel-qcow2-linux-0273ac349f08f4ff9ef88aaaf9c9f2aa6e87d2be.tar.gz kernel-qcow2-linux-0273ac349f08f4ff9ef88aaaf9c9f2aa6e87d2be.tar.xz kernel-qcow2-linux-0273ac349f08f4ff9ef88aaaf9c9f2aa6e87d2be.zip |
blkcg: handle dying request_queue when associating a blkg
Between v3 [1] and v4 [2] of the blkg association series, the
association point moved from generic_make_request_checks(), which is
called after the request enters the queue, to bio_set_dev(), which is when
the bio is formed before submit_bio(). When the request_queue goes away,
the blkgs supporting the request_queue are destroyed and then the
q->root_blkg is set to %NULL.
This patch adds a %NULL check to blkg_tryget_closest() to prevent the
NPE caused by the above. It also adds a guard to see if the
request_queue is dying when creating a blkg to prevent creating a blkg
for a dead request_queue.
[1] https://lore.kernel.org/lkml/20180911184137.35897-1-dennisszhou@gmail.com/
[2] https://lore.kernel.org/lkml/20181126211946.77067-1-dennis@kernel.org/
Fixes: 5cdf2e3fea5e ("blkcg: associate blkg when associating a device")
Reported-and-tested-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Dennis Zhou <dennis@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/net/wireless')
0 files changed, 0 insertions, 0 deletions