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

Configure Feed

Select the types of activity you want to include in your feed.

dcache: Replace simple_strtoul with kstrtoul in set_dhash_entries

Replace simple_strtoul() with the recommended kstrtoul() for parsing the
'dhash_entries=' boot parameter.

Check the return value of kstrtoul() and reject invalid values. This
adds error handling while preserving behavior for existing values, and
removes use of the deprecated simple_strtoul() helper.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://patch.msgid.link/20251216145236.44520-2-thorsten.blum@linux.dev
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner <brauner@kernel.org>

authored by

Thorsten Blum and committed by
Christian Brauner
b29a0a37 63ad216f

+1 -4
+1 -4
fs/dcache.c
··· 3227 3227 static __initdata unsigned long dhash_entries; 3228 3228 static int __init set_dhash_entries(char *str) 3229 3229 { 3230 - if (!str) 3231 - return 0; 3232 - dhash_entries = simple_strtoul(str, &str, 0); 3233 - return 1; 3230 + return kstrtoul(str, 0, &dhash_entries) == 0; 3234 3231 } 3235 3232 __setup("dhash_entries=", set_dhash_entries); 3236 3233