summaryrefslogtreecommitdiff
path: root/fs/proc/fd.c
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2018-02-07 02:36:51 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2018-02-07 05:32:43 +0300
commite3912ac37e07a13c70675cd75020694de4841c74 (patch)
tree78d2e8a58b5ff64444fedfa542fbaccd3d9a86c1 /fs/proc/fd.c
parent48c232395431c23d35cf3b4c5a090bd793316578 (diff)
downloadlinux-e3912ac37e07a13c70675cd75020694de4841c74.tar.xz
proc: use %u for pid printing and slightly less stack
PROC_NUMBUF is 13 which is enough for "negative int + \n + \0". However PIDs and TGIDs are never negative and newline is not a concern, so use just 10 per integer. Link: http://lkml.kernel.org/r/20171120203005.GA27743@avx2 Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Cc: Alexander Viro <viro@ftp.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/proc/fd.c')
-rw-r--r--fs/proc/fd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/proc/fd.c b/fs/proc/fd.c
index 96fc70225e54..6b80cd1e419a 100644
--- a/fs/proc/fd.c
+++ b/fs/proc/fd.c
@@ -236,7 +236,7 @@ static int proc_readfd_common(struct file *file, struct dir_context *ctx,
for (fd = ctx->pos - 2;
fd < files_fdtable(files)->max_fds;
fd++, ctx->pos++) {
- char name[PROC_NUMBUF];
+ char name[10 + 1];
int len;
if (!fcheck_files(files, fd))