accept should return ENFILE if it runs out of inodes

From: Andrea Arcangeli
Date: Wed Oct 20 2004 - 19:55:46 EST


EMFILE is only for the per-process fds limit, all other cases where
sock_alloc fails already returns -ENFILE too, must have been a typo.

patch for 2.4:

--- 2.4.23aa3/net/socket.c.~1~ 2004-07-04 02:09:33.000000000 +0200
+++ 2.4.23aa3/net/socket.c 2004-10-21 02:36:45.704715960 +0200
@@ -1068,7 +1068,7 @@ asmlinkage long sys_accept(int fd, struc
if (!sock)
goto out;

- err = -EMFILE;
+ err = -ENFILE;
if (!(newsock = sock_alloc()))
goto out_put;


patch for 2.6:

Index: linux-2.5/net/socket.c
===================================================================
RCS file: /home/andrea/crypto/cvs/linux-2.5/net/socket.c,v
retrieving revision 1.90
diff -u -p -r1.90 socket.c
--- linux-2.5/net/socket.c 8 Aug 2004 02:05:19 -0000 1.90
+++ linux-2.5/net/socket.c 21 Oct 2004 00:37:12 -0000
@@ -1354,7 +1354,7 @@ asmlinkage long sys_accept(int fd, struc
if (!sock)
goto out;

- err = -EMFILE;
+ err = -ENFILE;
if (!(newsock = sock_alloc()))
goto out_put;

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