lkml.org 
[lkml]   [2015]   [Apr]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] RLIMIT_NOFILE: reflect the state of the world
Date
The combination of outdated kernel defaults and lack of policies in
most init systems and init scripts has broken the Principle Of
Least Astonishment countless times, often leading to production
incidents.

One could argue that the vast majority of Linux users do not ever
benefit from such a low limit. As deployments that desire a low
RLIMIT_NOFILE are very few and hopefully maintained by engineers
competent enough to tweak their boot process accordingly,
let's make such enforcement opt-in.

---
Today is my birthday. My wish is to make the world a better place,
and sending this E-mail seems like a great way to do so.

include/asm-generic/resource.h | 2 +-
include/uapi/linux/fs.h | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git include/asm-generic/resource.h include/asm-generic/resource.h
index 5e752b9..c435cf4 100644
--- include/asm-generic/resource.h
+++ include/asm-generic/resource.h
@@ -16,7 +16,7 @@
[RLIMIT_CORE] = { 0, RLIM_INFINITY }, \
[RLIMIT_RSS] = { RLIM_INFINITY, RLIM_INFINITY }, \
[RLIMIT_NPROC] = { 0, 0 }, \
- [RLIMIT_NOFILE] = { INR_OPEN_CUR, INR_OPEN_MAX }, \
+ [RLIMIT_NOFILE] = { RLIM_INFINITY, RLIM_INFINITY }, \
[RLIMIT_MEMLOCK] = { MLOCK_LIMIT, MLOCK_LIMIT }, \
[RLIMIT_AS] = { RLIM_INFINITY, RLIM_INFINITY }, \
[RLIMIT_LOCKS] = { RLIM_INFINITY, RLIM_INFINITY }, \
diff --git include/uapi/linux/fs.h include/uapi/linux/fs.h
index 9b964a5..a69388f 100644
--- include/uapi/linux/fs.h
+++ include/uapi/linux/fs.h
@@ -22,8 +22,8 @@

/* Fixed constants first: */
#undef NR_OPEN
-#define INR_OPEN_CUR 1024 /* Initial setting for nfile rlimits */
-#define INR_OPEN_MAX 4096 /* Hard limit for nfile rlimits */
+#define INR_OPEN_CUR 1024 /* Deprecated: Initial setting for nfile rlimits */
+#define INR_OPEN_MAX 4096 /* Deprecated: Hard limit for nfile rlimits */

#define BLOCK_SIZE_BITS 10
#define BLOCK_SIZE (1<<BLOCK_SIZE_BITS)
--
2.3.5


\
 
 \ /
  Last update: 2015-04-02 00:41    [W:0.050 / U:0.516 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site