projects
/
linux-2.6-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
8a75189
)
blk-mq: check q->poll_stat in queue_poll_stat_show
author
Ming Lei
<ming.lei@redhat.com>
Thu, 2 Dec 2021 09:07:16 +0000
(17:07 +0800)
committer
Jens Axboe
<axboe@kernel.dk>
Thu, 2 Dec 2021 15:20:49 +0000
(08:20 -0700)
Without checking q->poll_stat in queue_poll_stat_show(), kernel panic
may be caused if q->poll_stat isn't allocated.
Fixes:
48b5c1fbcd8c
("block: only allocate poll_stats if there's a user of them")
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Link:
https://lore.kernel.org/r/20211202090716.3292244-1-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-mq-debugfs.c
patch
|
blob
|
blame
|
history
diff --git
a/block/blk-mq-debugfs.c
b/block/blk-mq-debugfs.c
index 7f27dca3a45eb8b3b34ee1a4cb2c9cff75f1c1ab..3a790eb4995c6cad4c2f20051a3dd067340bd62f 100644
(file)
--- a/
block/blk-mq-debugfs.c
+++ b/
block/blk-mq-debugfs.c
@@
-30,6
+30,9
@@
static int queue_poll_stat_show(void *data, struct seq_file *m)
struct request_queue *q = data;
int bucket;
+ if (!q->poll_stat)
+ return 0;
+
for (bucket = 0; bucket < (BLK_MQ_POLL_STATS_BKTS / 2); bucket++) {
seq_printf(m, "read (%d Bytes): ", 1 << (9 + bucket));
print_stat(m, &q->poll_stat[2 * bucket]);