Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5c1e24e2 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge changes Ie06d9430,Idc582ef4 into msm-next

* changes:
  defconfig: sdm855: enable CONFIG_DEBUG_SLUB_PANIC_ON
  mm: slub: panic for object and slab errors
parents 5591544b 824d61b1
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -419,6 +419,7 @@ CONFIG_DEBUG_SECTION_MISMATCH=y
# CONFIG_SECTION_MISMATCH_WARN_ONLY is not set
CONFIG_MAGIC_SYSRQ=y
CONFIG_DEBUG_PAGEALLOC=y
CONFIG_SLUB_DEBUG_PANIC_ON=y
CONFIG_DEBUG_PAGEALLOC_ENABLE_DEFAULT=y
CONFIG_PAGE_POISONING=y
CONFIG_DEBUG_OBJECTS=y
+12 −0
Original line number Diff line number Diff line
@@ -702,11 +702,21 @@ static void print_trailer(struct kmem_cache *s, struct page *page, u8 *p)
	dump_stack();
}

#ifdef CONFIG_SLUB_DEBUG_PANIC_ON
static void slab_panic(const char *cause)
{
	panic("%s\n", cause);
}
#else
static inline void slab_panic(const char *cause) {}
#endif

void object_err(struct kmem_cache *s, struct page *page,
			u8 *object, char *reason)
{
	slab_bug(s, "%s", reason);
	print_trailer(s, page, object);
	slab_panic(reason);
}

static void slab_err(struct kmem_cache *s, struct page *page,
@@ -721,6 +731,7 @@ static void slab_err(struct kmem_cache *s, struct page *page,
	slab_bug(s, "%s", buf);
	print_page_info(page);
	dump_stack();
	slab_panic("slab error");
}

static void init_object(struct kmem_cache *s, void *object, u8 val)
@@ -742,6 +753,7 @@ static void init_object(struct kmem_cache *s, void *object, u8 val)
static void restore_bytes(struct kmem_cache *s, char *message, u8 data,
						void *from, void *to)
{
	slab_panic("object poison overwritten");
	slab_fix(s, "Restoring 0x%p-0x%p=0x%x\n", from, to - 1, data);
	memset(from, data, to - from);
}