lkml.org 
[lkml]   [2000]   [Dec]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] NR_RESERVED_FILES broken in 2.4 too
Hi,

> user% ./fd-exhaustion # e.g. while(1) open("/dev/null",...);
> root# cat /proc/sys/fs/file-nr
> cat: /proc/sys/fs/file-nr: Too many open files in system
>
> The above happens even with increased NR_RESERVED_FILES to 96 [no
> wonder, get_empty_filp is broken].

no, it is not broken. But your experiment is broken. Don't do cat file-nr
but compile this C program
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[])
{
int fd, len;
static char buf[2048];

fd = open("/proc/sys/fs/file-nr", O_RDONLY);
if (fd == -1) {
perror("open");
exit(1);
}
while (1) {
len = read(fd, buf, 1024);
printf("len=%d %s", len, buf);
lseek(fd, 0, SEEK_SET);
sleep(1);
}
return 0;
}

and leave it running while doing experiments on the other console. You
will see that everything is fine -- there is no bug. No wonder you saw the
bug -- you ignored my 4 emails telling you otherwise :)

Regards,
Tigran

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

\
 
 \ /
  Last update: 2005-03-22 12:52    [W:0.091 / U:0.660 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site