Blame SOURCES/0017-sbitmapq-Fix-for-kernels-without-struct-wait_queue_h.patch

d67611
From 6bc3b74c6e2b0aaebe1bc164594e53b010efef56 Mon Sep 17 00:00:00 2001
d67611
From: Kazuhito Hagio <k-hagio-ab@nec.com>
d67611
Date: Fri, 10 Jun 2022 15:52:34 +0900
d67611
Subject: [PATCH 17/18] sbitmapq: Fix for kernels without struct
d67611
 wait_queue_head
d67611
d67611
The current struct wait_queue_head was renamed by kernel commit
d67611
9d9d676f595b ("sched/wait: Standardize internal naming of wait-queue heads")
d67611
at Linux 4.13.  Without the patch, on earlier kernels the "sbitmapq"
d67611
command fails with the following error:
d67611
d67611
  crash> sbitmapq ffff8801790b3b50
d67611
  depth = 128
d67611
  busy = 0
d67611
  bits_per_word = 32
d67611
  ...
d67611
  sbitmapq: invalid structure member offset: wait_queue_head_head
d67611
            FILE: sbitmap.c  LINE: 344  FUNCTION: sbitmap_queue_show()
d67611
d67611
Signed-off-by: Kazuhito Hagio <k-hagio-ab@nec.com>
d67611
Signed-off-by: Lianbo Jiang <lijiang@redhat.com>
d67611
---
d67611
 sbitmap.c | 5 ++++-
d67611
 1 file changed, 4 insertions(+), 1 deletion(-)
d67611
d67611
diff --git a/sbitmap.c b/sbitmap.c
d67611
index bb2f19e6207b..be5d30a8ea88 100644
d67611
--- a/sbitmap.c
d67611
+++ b/sbitmap.c
d67611
@@ -341,7 +341,10 @@ static void sbitmap_queue_show(const struct sbitmap_queue_context *sqc,
d67611
 	sbq_wait_state_size = SIZE(sbq_wait_state);
d67611
 	wait_cnt_off = OFFSET(sbq_wait_state_wait_cnt);
d67611
 	wait_off = OFFSET(sbq_wait_state_wait);
d67611
-	list_head_off = OFFSET(wait_queue_head_head);
d67611
+	if (VALID_MEMBER(wait_queue_head_head)) /* 4.13 and later */
d67611
+		list_head_off = OFFSET(wait_queue_head_head);
d67611
+	else
d67611
+		list_head_off = OFFSET(__wait_queue_head_task_list);
d67611
 
d67611
 	sbq_wait_state_buf = GETBUF(sbq_wait_state_size);
d67611
 
d67611
-- 
d67611
2.30.2
d67611