diff options
author | Ming Lei <ming.lei@redhat.com> | 2022-03-08 10:32:19 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2022-03-09 05:39:38 +0300 |
commit | 4e5cc99e1e485954a9c09872e0eeea570fb2b5a5 (patch) | |
tree | a48a03ee09ac2cad11e39b6d435080229b649f73 /block/blk-mq-debugfs.h | |
parent | 4f481208749a22d3570073e629dbc27d7d27c8da (diff) | |
download | linux-4e5cc99e1e485954a9c09872e0eeea570fb2b5a5.tar.xz |
blk-mq: manage hctx map via xarray
First code becomes more clean by switching to xarray from plain array.
Second use-after-free on q->queue_hw_ctx can be fixed because
queue_for_each_hw_ctx() may be run when updating nr_hw_queues is
in-progress. With this patch, q->hctx_table is defined as xarray, and
this structure will share same lifetime with request queue, so
queue_for_each_hw_ctx() can use q->hctx_table to lookup hctx reliably.
Reported-by: Yu Kuai <yukuai3@huawei.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20220308073219.91173-7-ming.lei@redhat.com
[axboe: fix blk_mq_hw_ctx forward declaration]
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-mq-debugfs.h')
-rw-r--r-- | block/blk-mq-debugfs.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/block/blk-mq-debugfs.h b/block/blk-mq-debugfs.h index a68aa6041a10..69918f4170d6 100644 --- a/block/blk-mq-debugfs.h +++ b/block/blk-mq-debugfs.h @@ -6,6 +6,8 @@ #include <linux/seq_file.h> +struct blk_mq_hw_ctx; + struct blk_mq_debugfs_attr { const char *name; umode_t mode; |