Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit484cfac

Browse files
efarmantorvalds
authored andcommitted
mm, slub: restore initial kmem_cache flags
The routine that applies debug flags to the kmem_cache slabsinadvertantly prevents non-debug flags from being applied to thosesame objects. That is, if slub_debug=<flag>,<slab> is specified,non-debugged slabs will end up having flags of zero, and the slabsmay be unusable.Fix this by including the input flags for non-matching slabs with thecontents of slub_debug, so that the caches are created as expectedalongside any debugging options that may be requested. With this, wecan remove the check for a NULL slub_debug_string, since it's coveredby the loop itself.Fixes:e17f1df ("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.comSigned-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parentd3d45f8 commit484cfac

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

‎mm/slub.c‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1413,10 +1413,6 @@ slab_flags_t kmem_cache_flags(unsigned int object_size,
14131413
char*next_block;
14141414
slab_flags_tblock_flags;
14151415

1416-
/* If slub_debug = 0, it folds into the if conditional. */
1417-
if (!slub_debug_string)
1418-
returnflags |slub_debug;
1419-
14201416
len=strlen(name);
14211417
next_block=slub_debug_string;
14221418
/* Go through all blocks of debug options, see if any matches our slab's name */
@@ -1450,7 +1446,7 @@ slab_flags_t kmem_cache_flags(unsigned int object_size,
14501446
}
14511447
}
14521448

1453-
returnslub_debug;
1449+
returnflags |slub_debug;
14541450
}
14551451
#else/* !CONFIG_SLUB_DEBUG */
14561452
staticinlinevoidsetup_object_debug(structkmem_cache*s,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp