[PATCH 0/1] fs: cap max_files at LONG_MAX

From: Christian Brauner
Date: Wed Oct 17 2018 - 19:12:24 EST


Hey,

This is a follow-up to [1] and [2] that caps the file-max sysctl at
LONG_MAX and rejects any larger values with EINVAL because of the way
percup counters work. This intends to align the kernel side of files_max
handling as well by capping the maximum number of files at LONG_MAX
until such time as we have the need and the precision for percpu
unsigned long counters.

Note, that in a quick discussion with Tejun investigating percpu unsigned
long counters it became obvious that technically, both LONG_MAX and
ULONG_MAX should be unreachable. Given that an fd is usually larger than 2
bytes one would likely run out of address space before even reaching the
LONG_MAX limit.

Al, I suggested this patch in [3] but I didn't see you reply so I'm not
sure whether you would be in favor of this or not.

Thanks!
Christian

[1]: https://lkml.org/lkml/2018/10/17/74
[2]: https://lkml.org/lkml/2018/10/17/184
[3]: https://lkml.org/lkml/2018/10/17/555

Christian Brauner (1):
fs: cap max_files at LONG_MAX

fs/file_table.c | 8 ++++++++
1 file changed, 8 insertions(+)

--
2.19.1