From: Ernie Petrides Roland McGrath has pointed out to me that my original patch for this problem only handles the case of ERESTARTSYS, but doesn't treat the three other restart pseudo-error codes similarly. I don't see how any code currently in the 2.6.17 source tree could possibly result in any ERESTARTNOINTR, ERESTARTNOHAND, or ERESTART_RESTARTBLOCK errors being sent back through filp_close(). But if you prefer the extra checks for completeness, feel free to add the incremental patch below (on top of my previous patch to check for ERESTARTSYS). Cc: Roland McGrath Signed-off-by: Andrew Morton --- fs/open.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletion(-) diff -puN fs/open.c~fix-wrong-error-code-on-interrupted-close-syscalls-fix fs/open.c --- a/fs/open.c~fix-wrong-error-code-on-interrupted-close-syscalls-fix +++ a/fs/open.c @@ -1189,7 +1189,13 @@ asmlinkage long sys_close(unsigned int f retval = filp_close(filp, files); /* can't restart close syscall because file table entry was cleared */ - return (retval == -ERESTARTSYS) ? -EINTR : retval; + if (unlikely(retval == -ERESTARTSYS || + retval == -ERESTARTNOINTR || + retval == -ERESTARTNOHAND || + retval == -ERESTART_RESTARTBLOCK)) + retval = -EINTR; + + return retval; out_unlock: spin_unlock(&files->file_lock); _