summaryrefslogtreecommitdiffstats
path: root/arch/xtensa
diff options
context:
space:
mode:
authorMing Lei <ming.lei@redhat.com>2018-01-06 16:27:40 +0800
committerJens Axboe <axboe@kernel.dk>2018-01-06 09:25:36 -0700
commitfb350e0ad99359768e1e80b4784692031ec340e4 (patch)
tree25d87e34b68ada63eb442c6269b031f037011520 /arch/xtensa
parent7d4901a90d02500c8011472a060f9b2e60e6e605 (diff)
downloadlinux-fb350e0ad99359768e1e80b4784692031ec340e4.tar.gz
linux-fb350e0ad99359768e1e80b4784692031ec340e4.tar.bz2
linux-fb350e0ad99359768e1e80b4784692031ec340e4.zip
blk-mq: fix race between updating nr_hw_queues and switching io sched
In both elevator_switch_mq() and blk_mq_update_nr_hw_queues(), sched tags can be allocated, and q->nr_hw_queue is used, and race is inevitable, for example: blk_mq_init_sched() may trigger use-after-free on hctx, which is freed in blk_mq_realloc_hw_ctxs() when nr_hw_queues is decreased. This patch fixes the race be holding q->sysfs_lock. Reviewed-by: Christoph Hellwig <hch@lst.de> Reported-by: Yi Zhang <yi.zhang@redhat.com> Tested-by: Yi Zhang <yi.zhang@redhat.com> Signed-off-by: Ming Lei <ming.lei@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'arch/xtensa')
0 files changed, 0 insertions, 0 deletions