Message ID | 4731d54723b841599882a24f7aa73aaa@huawei.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | [RFC] RLIMIT_NOFILE: the maximum number of open files or the maximum fd index? | expand |
diff --git a/fs/file.c b/fs/file.c index fb1011c..e47ddac 100644 --- a/fs/file.c +++ b/fs/file.c @@ -561,6 +561,7 @@ static int alloc_fd(unsigned start, unsigned end, unsigned flags) */ error = -EMFILE; if (unlikely(fd >= end)) + // There may be unclosed fd between [end, max]. the number of open files can be greater than RLIMIT_NOFILE. goto out; if (unlikely(fd >= fdt->max_fds)) {