PROC_BLOCK_SIZE in proc_info_read()

From: Lev Makhlis
Date: Fri Jan 16 2004 - 23:11:42 EST


proc_info_read() (in fs/proc/base.c) uses this macro to limit the size
of a single read:

#define PROC_BLOCK_SIZE (3*1024) /* 4K page size but our output
routines use some slack for overruns */

It seems to me like it's a legacy from array_read() in 2.2.x and can be
safely removed. Besides an outdated assumption about the page size,
the value is not passed down to (*proc_read)(), so it cannot guard
against any overruns, and serves no useful purpose.
Am I missing anything?

(This is not to be confused with PROC_BLOCK_SIZE in fs/proc/generic.c)

The reason it bothers me is that if you have a process with a really long
command line, then /proc/<pid>/cmdline "contains" up to PAGE_SIZE bytes,
but sys_read() only returns 3072, and needs to be called repeatedly.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/