diff options
Diffstat (limited to 'fs/open.c')
| -rw-r--r-- | fs/open.c | 17 |
1 files changed, 14 insertions, 3 deletions
| @@ -322,7 +322,7 @@ static long do_sys_ftruncate(unsigned int fd, loff_t length, int small) | |||
| 322 | 322 | ||
| 323 | error = locks_verify_truncate(inode, file, length); | 323 | error = locks_verify_truncate(inode, file, length); |
| 324 | if (!error) | 324 | if (!error) |
| 325 | error = do_truncate(dentry, length, 0, file); | 325 | error = do_truncate(dentry, length, ATTR_MTIME|ATTR_CTIME, file); |
| 326 | out_putf: | 326 | out_putf: |
| 327 | fput(file); | 327 | fput(file); |
| 328 | out: | 328 | out: |
| @@ -546,7 +546,8 @@ asmlinkage long sys_chdir(const char __user * filename) | |||
| 546 | struct nameidata nd; | 546 | struct nameidata nd; |
| 547 | int error; | 547 | int error; |
| 548 | 548 | ||
| 549 | error = __user_walk(filename, LOOKUP_FOLLOW|LOOKUP_DIRECTORY, &nd); | 549 | error = __user_walk(filename, |
| 550 | LOOKUP_FOLLOW|LOOKUP_DIRECTORY|LOOKUP_CHDIR, &nd); | ||
| 550 | if (error) | 551 | if (error) |
| 551 | goto out; | 552 | goto out; |
| 552 | 553 | ||
| @@ -1172,6 +1173,7 @@ asmlinkage long sys_close(unsigned int fd) | |||
| 1172 | struct file * filp; | 1173 | struct file * filp; |
| 1173 | struct files_struct *files = current->files; | 1174 | struct files_struct *files = current->files; |
| 1174 | struct fdtable *fdt; | 1175 | struct fdtable *fdt; |
| 1176 | int retval; | ||
| 1175 | 1177 | ||
| 1176 | spin_lock(&files->file_lock); | 1178 | spin_lock(&files->file_lock); |
| 1177 | fdt = files_fdtable(files); | 1179 | fdt = files_fdtable(files); |
| @@ -1184,7 +1186,16 @@ asmlinkage long sys_close(unsigned int fd) | |||
| 1184 | FD_CLR(fd, fdt->close_on_exec); | 1186 | FD_CLR(fd, fdt->close_on_exec); |
| 1185 | __put_unused_fd(files, fd); | 1187 | __put_unused_fd(files, fd); |
| 1186 | spin_unlock(&files->file_lock); | 1188 | spin_unlock(&files->file_lock); |
| 1187 | 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; | ||
| 1188 | 1199 | ||
| 1189 | out_unlock: | 1200 | out_unlock: |
| 1190 | spin_unlock(&files->file_lock); | 1201 | spin_unlock(&files->file_lock); |
