Blame SOURCES/0006-memory-Handle-struct-slab-changes-on-Linux-5.17-rc1-.patch

412566
From a392b27653e4e75460753522af0f006006b4dc4e Mon Sep 17 00:00:00 2001
412566
From: Alexander Egorenkov <egorenar@linux.ibm.com>
412566
Date: Mon, 6 Dec 2021 16:04:19 +0100
412566
Subject: [PATCH 06/11] memory: Handle struct slab changes on Linux 5.17-rc1
412566
 and later
412566
412566
Since kernel commit d122019bf061 ("mm: Split slab into its own type"),
412566
the struct slab is used for both SLAB and SLUB. Therefore, don't depend
412566
on the non-presence of the struct slab to decide whether SLAB implementation
412566
should be chosen and use the member variable "cpu_slab" of the struct
412566
kmem_cache instead, it should be present only in SLUB.
412566
412566
Without the patch, crash fails to start with the error message:
412566
412566
  crash: invalid structure member offset: kmem_cache_s_num
412566
             FILE: memory.c  LINE: 9619  FUNCTION: kmem_cache_init()
412566
412566
Signed-off-by: Alexander Egorenkov <egorenar@linux.ibm.com>
412566
Signed-off-by: Lianbo Jiang <lijiang@redhat.com>
412566
---
412566
 memory.c | 3 ++-
412566
 1 file changed, 2 insertions(+), 1 deletion(-)
412566
412566
diff --git a/memory.c b/memory.c
412566
index 86c02c132890..5af45fd7d834 100644
412566
--- a/memory.c
412566
+++ b/memory.c
412566
@@ -576,7 +576,8 @@ vm_init(void)
412566
 		STRUCT_SIZE_INIT(cpucache_s, "cpucache_s");
412566
 
412566
         } else if (!VALID_STRUCT(kmem_slab_s) && 
412566
-		   !VALID_STRUCT(slab_s) && 
412566
+		   !VALID_STRUCT(slab_s) &&
412566
+		   !MEMBER_EXISTS("kmem_cache", "cpu_slab") &&
412566
 		   (VALID_STRUCT(slab) || (vt->flags & SLAB_OVERLOAD_PAGE))) {
412566
                 vt->flags |= PERCPU_KMALLOC_V2;
412566
 
412566
-- 
412566
2.20.1
412566