Blame SOURCES/0002-sbitmapq-remove-struct-and-member-validation-in-sbit.patch

d67611
From 364b2e413c69daf189d2bc0238e3ba9b0dcbd937 Mon Sep 17 00:00:00 2001
d67611
From: Lianbo Jiang <lijiang@redhat.com>
d67611
Date: Mon, 23 May 2022 18:04:13 +0800
d67611
Subject: [PATCH 02/18] sbitmapq: remove struct and member validation in
d67611
 sbitmapq_init()
d67611
d67611
Let's remove the struct and member validation from sbitmapq_init(), which
d67611
will help the crash to display the actual error when the sbitmapq fails.
d67611
d67611
Without the patch:
d67611
  crash> sbitmapq ffff8e99d0dc8010
d67611
  sbitmapq: command not supported or applicable on this architecture or kernel
d67611
d67611
With the patch:
d67611
  crash> sbitmapq ffff8e99d0dc8010
d67611
d67611
  sbitmapq: invalid structure member offset: sbitmap_queue_alloc_hint
d67611
          FILE: sbitmap.c  LINE: 365  FUNCTION: sbitmap_queue_context_load()
d67611
d67611
Signed-off-by: Lianbo Jiang <lijiang@redhat.com>
d67611
---
d67611
 sbitmap.c | 24 ------------------------
d67611
 1 file changed, 24 deletions(-)
d67611
d67611
diff --git a/sbitmap.c b/sbitmap.c
d67611
index 96a61e6c2c71..7693eef6cebd 100644
d67611
--- a/sbitmap.c
d67611
+++ b/sbitmap.c
d67611
@@ -525,30 +525,6 @@ void sbitmapq_init(void)
d67611
 	MEMBER_OFFSET_INIT(sbq_wait_state_wait_cnt, "sbq_wait_state", "wait_cnt");
d67611
 	MEMBER_OFFSET_INIT(sbq_wait_state_wait, "sbq_wait_state", "wait");
d67611
 
d67611
-	if (!VALID_SIZE(sbitmap_word) ||
d67611
-			!VALID_SIZE(sbitmap) ||
d67611
-			!VALID_SIZE(sbitmap_queue) ||
d67611
-			!VALID_SIZE(sbq_wait_state) ||
d67611
-			INVALID_MEMBER(sbitmap_word_depth) ||
d67611
-			INVALID_MEMBER(sbitmap_word_word) ||
d67611
-			INVALID_MEMBER(sbitmap_word_cleared) ||
d67611
-			INVALID_MEMBER(sbitmap_depth) ||
d67611
-			INVALID_MEMBER(sbitmap_shift) ||
d67611
-			INVALID_MEMBER(sbitmap_map_nr) ||
d67611
-			INVALID_MEMBER(sbitmap_map) ||
d67611
-			INVALID_MEMBER(sbitmap_queue_sb) ||
d67611
-			INVALID_MEMBER(sbitmap_queue_alloc_hint) ||
d67611
-			INVALID_MEMBER(sbitmap_queue_wake_batch) ||
d67611
-			INVALID_MEMBER(sbitmap_queue_wake_index) ||
d67611
-			INVALID_MEMBER(sbitmap_queue_ws) ||
d67611
-			INVALID_MEMBER(sbitmap_queue_ws_active) ||
d67611
-			INVALID_MEMBER(sbitmap_queue_round_robin) ||
d67611
-			INVALID_MEMBER(sbitmap_queue_min_shallow_depth) ||
d67611
-			INVALID_MEMBER(sbq_wait_state_wait_cnt) ||
d67611
-			INVALID_MEMBER(sbq_wait_state_wait)) {
d67611
-		command_not_supported();
d67611
-	}
d67611
-
d67611
 	sb_flags |= SB_FLAG_INIT;
d67611
 }
d67611
 
d67611
-- 
d67611
2.30.2
d67611