aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/open.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/fs/open.c b/fs/open.c
index 1574d8fe4909..304c1c7814cb 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -1173,6 +1173,7 @@ asmlinkage long sys_close(unsigned int fd)
1173 struct file * filp; 1173 struct file * filp;
1174 struct files_struct *files = current->files; 1174 struct files_struct *files = current->files;
1175 struct fdtable *fdt; 1175 struct fdtable *fdt;
1176 int retval;
1176 1177
1177 spin_lock(&files->file_lock); 1178 spin_lock(&files->file_lock);
1178 fdt = files_fdtable(files); 1179 fdt = files_fdtable(files);
@@ -1185,7 +1186,16 @@ asmlinkage long sys_close(unsigned int fd)
1185 FD_CLR(fd, fdt->close_on_exec); 1186 FD_CLR(fd, fdt->close_on_exec);
1186 __put_unused_fd(files, fd); 1187 __put_unused_fd(files, fd);
1187 spin_unlock(&files->file_lock); 1188 spin_unlock(&files->file_lock);
1188 return filp_close(filp, files); 1189 retval = filp_close(filp, files);
1190
1191 /* can't restart close syscall because file table entry was cleared */
1192 if (unlikely(retval == -ERESTARTSYS ||
1193 retval == -ERESTARTNOINTR ||
1194 retval == -ERESTARTNOHAND ||
1195 retval == -ERESTART_RESTARTBLOCK))
1196 retval = -EINTR;
1197
1198 return retval;
1189 1199
1190out_unlock: 1200out_unlock:
1191 spin_unlock(&files->file_lock); 1201 spin_unlock(&files->file_lock);