]> git.baikalelectronics.ru Git - kernel.git/commit
mm, slub: restore initial kmem_cache flags
authorEric Farman <farman@linux.ibm.com>
Sat, 3 Oct 2020 05:21:41 +0000 (22:21 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 3 Oct 2020 18:28:12 +0000 (11:28 -0700)
commitd5e83d95d7f80d352fdd87a1c25ff665970dc95a
tree312ec6886d3d16757f1bfdc8b8ccf2f760037752
parent2e9fcd7ae00c6df04270e15b0bbc61337f98048e
mm, slub: restore initial kmem_cache flags

The routine that applies debug flags to the kmem_cache slabs
inadvertantly prevents non-debug flags from being applied to those
same objects.  That is, if slub_debug=<flag>,<slab> is specified,
non-debugged slabs will end up having flags of zero, and the slabs
may be unusable.

Fix this by including the input flags for non-matching slabs with the
contents of slub_debug, so that the caches are created as expected
alongside any debugging options that may be requested.  With this, we
can remove the check for a NULL slub_debug_string, since it's covered
by the loop itself.

Fixes: 564b1e83de8e ("mm, slub: extend slub_debug syntax for multiple blocks")
Signed-off-by: Eric Farman <farman@linux.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Kees Cook <keescook@chromium.org>
Cc: Christoph Lameter <cl@linux.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: David Rientjes <rientjes@google.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Link: https://lkml.kernel.org/r/20200930161931.28575-1-farman@linux.ibm.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/slub.c