Kernel commit <9a14d6ce4135> ("block: remove debugfs blk_mq_ctx
dispatched/merged/completed attributes") removed the member
rq_dispatched and rq_completed from struct blk_mq_ctx. Without
this patch, crash will fail with the following error:

crash> dev -d
MAJOR GENDISK            NAME       REQUEST_QUEUE      TOTAL ASYNC  SYNC

dev: invalid structure member offset: blk_mq_ctx_rq_dispatched
     FILE: dev.c  LINE: 4229  FUNCTION: get_one_mctx_diskio()

Signed-off-by: Lianbo Jiang <[email protected]>
---
 dev.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/dev.c b/dev.c
index effe789f38d8..dd21511e5dfc 100644
--- a/dev.c
+++ b/dev.c
@@ -4246,6 +4246,10 @@ get_mq_diskio(unsigned long q, unsigned long *mq_count)
        unsigned long mctx_addr;
        struct diskio tmp;
 
+       if (!MEMBER_EXISTS("blk_mq_ctx", "rq_dispatched") &&
+               !MEMBER_EXISTS("blk_mq_ctx", "rq_completed"))
+               return;
+
        memset(&tmp, 0x00, sizeof(struct diskio));
 
        readmem(q + OFFSET(request_queue_queue_ctx), KVADDR, &queue_ctx,
-- 
2.20.1

--
Crash-utility mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/crash-utility

Reply via email to