diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-07-30 13:33:48 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-30 13:33:48 -0400 |
commit | 15dd859cacf312f606f54502d1f66537a1e5c78c (patch) | |
tree | e50e125eaa6da83fa715704e53c1bde013d1ef8e /fs/file.c | |
parent | b2d9d33412b9d13a40cd314d93ab517950fc5950 (diff) | |
parent | 6e86841d05f371b5b9b86ce76c02aaee83352298 (diff) |
Merge commit 'v2.6.27-rc1' into x86/core
Conflicts:
include/asm-x86/dma-mapping.h
include/asm-x86/namei.h
include/asm-x86/uaccess.h
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'fs/file.c')
-rw-r--r-- | fs/file.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -250,9 +250,18 @@ int expand_files(struct files_struct *files, int nr) | |||
250 | struct fdtable *fdt; | 250 | struct fdtable *fdt; |
251 | 251 | ||
252 | fdt = files_fdtable(files); | 252 | fdt = files_fdtable(files); |
253 | |||
254 | /* | ||
255 | * N.B. For clone tasks sharing a files structure, this test | ||
256 | * will limit the total number of files that can be opened. | ||
257 | */ | ||
258 | if (nr >= current->signal->rlim[RLIMIT_NOFILE].rlim_cur) | ||
259 | return -EMFILE; | ||
260 | |||
253 | /* Do we need to expand? */ | 261 | /* Do we need to expand? */ |
254 | if (nr < fdt->max_fds) | 262 | if (nr < fdt->max_fds) |
255 | return 0; | 263 | return 0; |
264 | |||
256 | /* Can we expand? */ | 265 | /* Can we expand? */ |
257 | if (nr >= sysctl_nr_open) | 266 | if (nr >= sysctl_nr_open) |
258 | return -EMFILE; | 267 | return -EMFILE; |