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

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