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.

sysctl: fix duplicate path separator in printed entries

sysctl_print_dir() always terminates the printed path name with a slash,
so printing a slash before the file part causes a duplicate like in

sysctl duplicate entry: /kernel//perf_user_access

Fix this by dropping the extra slash.

Link: https://lkml.kernel.org/r/e3054d605dc56f83971e4b6d2f5fa63a978720ad.1641551872.git.geert+renesas@glider.be
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
Acked-by: Luis Chamberlain <mcgrof@kernel.org>
Cc: Iurii Zaikin <yzaikin@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Geert Uytterhoeven and committed by
Linus Torvalds
153ee1c4 51a18734

+4 -4
+4 -4
fs/proc/proc_sysctl.c
··· 163 163 else { 164 164 pr_err("sysctl duplicate entry: "); 165 165 sysctl_print_dir(head->parent); 166 - pr_cont("/%s\n", entry->procname); 166 + pr_cont("%s\n", entry->procname); 167 167 return -EEXIST; 168 168 } 169 169 } ··· 1020 1020 if (IS_ERR(subdir)) { 1021 1021 pr_err("sysctl could not get directory: "); 1022 1022 sysctl_print_dir(dir); 1023 - pr_cont("/%*.*s %ld\n", 1024 - namelen, namelen, name, PTR_ERR(subdir)); 1023 + pr_cont("%*.*s %ld\n", namelen, namelen, name, 1024 + PTR_ERR(subdir)); 1025 1025 } 1026 1026 drop_sysctl_table(&dir->header); 1027 1027 if (new) ··· 1626 1626 else { 1627 1627 pr_err("sysctl link missing during unregister: "); 1628 1628 sysctl_print_dir(parent); 1629 - pr_cont("/%s\n", name); 1629 + pr_cont("%s\n", name); 1630 1630 } 1631 1631 } 1632 1632 }