Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mm/slub.c: parse slub_debug O option in switch statement

By moving the O option detection into the switch statement, we allow this
parameter to be combined with other options correctly. Previously options
like slub_debug=OFZ would only detect the 'o' and use DEBUG_DEFAULT_FLAGS
to fill in the rest of the flags.

Signed-off-by: Chris J Arges <chris.j.arges@canonical.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Pekka Enberg <penberg@kernel.org>
Acked-by: David Rientjes <rientjes@google.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Chris J Arges and committed by
Linus Torvalds
08303a73 ef2a5153

+7 -9
+7 -9
mm/slub.c
··· 1137 1137 */ 1138 1138 goto check_slabs; 1139 1139 1140 - if (tolower(*str) == 'o') { 1141 - /* 1142 - * Avoid enabling debugging on caches if its minimum order 1143 - * would increase as a result. 1144 - */ 1145 - disable_higher_order_debug = 1; 1146 - goto out; 1147 - } 1148 - 1149 1140 slub_debug = 0; 1150 1141 if (*str == '-') 1151 1142 /* ··· 1166 1175 break; 1167 1176 case 'a': 1168 1177 slub_debug |= SLAB_FAILSLAB; 1178 + break; 1179 + case 'o': 1180 + /* 1181 + * Avoid enabling debugging on caches if its minimum 1182 + * order would increase as a result. 1183 + */ 1184 + disable_higher_order_debug = 1; 1169 1185 break; 1170 1186 default: 1171 1187 pr_err("slub_debug option '%c' unknown. skipped\n",