Al Viro 08f05c4974 Return the right error value when dup[23]() newfd argument is too large
Jack Lin reports that the error return from dup3() for the RLIMIT_NOFILE
case changed incorrectly after 3.6.

The culprit is commit f33ff9927f42 ("take rlimit check to callers of
expand_files()") which when it moved the "return -EMFILE" out to the
caller, didn't notice that the dup3() had special code to turn the
EMFILE return into EBADF.

The replace_fd() helper that got added later then inherited the bug too.

Reported-by: Jack Lin <linliangjie@huawei.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
[ Noted more bugs, wrote proper changelog, fixed up typos - Linus ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-10-30 21:27:28 -07:00
..
2012-07-14 16:38:34 +04:00
2012-10-09 23:33:38 -04:00
2012-10-09 16:22:17 +09:00
2012-10-09 23:33:38 -04:00
2012-10-09 15:04:25 +01:00
2012-10-17 09:18:38 -05:00
2012-10-09 18:35:22 -04:00
2012-10-09 16:22:17 +09:00
2012-10-09 16:22:17 +09:00
2012-10-06 03:05:31 +09:00
2012-07-14 16:34:47 +04:00
2012-10-09 23:33:39 -04:00
2012-10-09 16:22:17 +09:00
2012-10-09 23:33:39 -04:00
2012-09-07 14:57:46 -04:00
2012-07-14 16:34:47 +04:00
2012-03-20 21:29:46 -04:00
2012-03-20 21:29:46 -04:00
2012-10-22 08:50:37 +03:00
2012-10-16 13:36:50 -04:00
2012-10-09 15:52:31 +09:00
2012-07-14 16:32:47 +04:00
2012-10-09 18:35:22 -04:00
2012-07-14 16:32:48 +04:00
2012-09-26 21:08:52 -04:00
2012-10-09 23:33:39 -04:00