Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * linux/fs/readdir.c |
| 3 | * |
| 4 | * Copyright (C) 1995 Linus Torvalds |
| 5 | */ |
| 6 | |
Kevin Winchester | 85c9fe8 | 2010-08-09 17:20:22 -0700 | [diff] [blame] | 7 | #include <linux/stddef.h> |
Milind Arun Choudhary | 022a169 | 2007-05-08 00:29:02 -0700 | [diff] [blame] | 8 | #include <linux/kernel.h> |
Paul Gortmaker | 630d9c4 | 2011-11-16 23:57:37 -0500 | [diff] [blame] | 9 | #include <linux/export.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 10 | #include <linux/time.h> |
| 11 | #include <linux/mm.h> |
| 12 | #include <linux/errno.h> |
| 13 | #include <linux/stat.h> |
| 14 | #include <linux/file.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 15 | #include <linux/fs.h> |
Heinrich Schuchardt | d4c7cf6 | 2014-06-04 16:05:41 -0700 | [diff] [blame] | 16 | #include <linux/fsnotify.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 17 | #include <linux/dirent.h> |
| 18 | #include <linux/security.h> |
| 19 | #include <linux/syscalls.h> |
| 20 | #include <linux/unistd.h> |
| 21 | |
| 22 | #include <asm/uaccess.h> |
| 23 | |
Al Viro | 5c0ba4e | 2013-05-15 13:52:59 -0400 | [diff] [blame] | 24 | int iterate_dir(struct file *file, struct dir_context *ctx) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 25 | { |
Al Viro | 496ad9a | 2013-01-23 17:07:38 -0500 | [diff] [blame] | 26 | struct inode *inode = file_inode(file); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 27 | int res = -ENOTDIR; |
Al Viro | 72c2d53 | 2013-09-22 16:27:52 -0400 | [diff] [blame] | 28 | if (!file->f_op->iterate) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 29 | goto out; |
| 30 | |
| 31 | res = security_file_permission(file, MAY_READ); |
| 32 | if (res) |
| 33 | goto out; |
| 34 | |
Liam R. Howlett | da78451 | 2007-12-06 17:39:54 -0500 | [diff] [blame] | 35 | res = mutex_lock_killable(&inode->i_mutex); |
| 36 | if (res) |
| 37 | goto out; |
| 38 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 39 | res = -ENOENT; |
| 40 | if (!IS_DEADDIR(inode)) { |
Al Viro | 2233f31 | 2013-05-22 21:44:23 -0400 | [diff] [blame] | 41 | ctx->pos = file->f_pos; |
| 42 | res = file->f_op->iterate(file, ctx); |
| 43 | file->f_pos = ctx->pos; |
Heinrich Schuchardt | d4c7cf6 | 2014-06-04 16:05:41 -0700 | [diff] [blame] | 44 | fsnotify_access(file); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 45 | file_accessed(file); |
| 46 | } |
Al Viro | 5955102 | 2016-01-22 15:40:57 -0500 | [diff] [blame] | 47 | inode_unlock(inode); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 48 | out: |
| 49 | return res; |
| 50 | } |
Al Viro | 5c0ba4e | 2013-05-15 13:52:59 -0400 | [diff] [blame] | 51 | EXPORT_SYMBOL(iterate_dir); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 52 | |
| 53 | /* |
| 54 | * Traditional linux readdir() handling.. |
| 55 | * |
| 56 | * "count=1" is a special case, meaning that the buffer is one |
| 57 | * dirent-structure in size and that the code can't handle more |
| 58 | * anyway. Thus the special "fillonedir()" function for that |
| 59 | * case (the low-level handlers don't need to care about this). |
| 60 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 61 | |
| 62 | #ifdef __ARCH_WANT_OLD_READDIR |
| 63 | |
| 64 | struct old_linux_dirent { |
| 65 | unsigned long d_ino; |
| 66 | unsigned long d_offset; |
| 67 | unsigned short d_namlen; |
| 68 | char d_name[1]; |
| 69 | }; |
| 70 | |
| 71 | struct readdir_callback { |
Al Viro | 5c0ba4e | 2013-05-15 13:52:59 -0400 | [diff] [blame] | 72 | struct dir_context ctx; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 73 | struct old_linux_dirent __user * dirent; |
| 74 | int result; |
| 75 | }; |
| 76 | |
Miklos Szeredi | ac7576f | 2014-10-30 17:37:34 +0100 | [diff] [blame] | 77 | static int fillonedir(struct dir_context *ctx, const char *name, int namlen, |
| 78 | loff_t offset, u64 ino, unsigned int d_type) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 79 | { |
Miklos Szeredi | ac7576f | 2014-10-30 17:37:34 +0100 | [diff] [blame] | 80 | struct readdir_callback *buf = |
| 81 | container_of(ctx, struct readdir_callback, ctx); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 82 | struct old_linux_dirent __user * dirent; |
David Howells | afefdbb | 2006-10-03 01:13:46 -0700 | [diff] [blame] | 83 | unsigned long d_ino; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 84 | |
| 85 | if (buf->result) |
| 86 | return -EINVAL; |
David Howells | afefdbb | 2006-10-03 01:13:46 -0700 | [diff] [blame] | 87 | d_ino = ino; |
Al Viro | 8f3f655 | 2008-08-12 00:28:24 -0400 | [diff] [blame] | 88 | if (sizeof(d_ino) < sizeof(ino) && d_ino != ino) { |
| 89 | buf->result = -EOVERFLOW; |
David Howells | afefdbb | 2006-10-03 01:13:46 -0700 | [diff] [blame] | 90 | return -EOVERFLOW; |
Al Viro | 8f3f655 | 2008-08-12 00:28:24 -0400 | [diff] [blame] | 91 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 92 | buf->result++; |
| 93 | dirent = buf->dirent; |
| 94 | if (!access_ok(VERIFY_WRITE, dirent, |
| 95 | (unsigned long)(dirent->d_name + namlen + 1) - |
| 96 | (unsigned long)dirent)) |
| 97 | goto efault; |
David Howells | afefdbb | 2006-10-03 01:13:46 -0700 | [diff] [blame] | 98 | if ( __put_user(d_ino, &dirent->d_ino) || |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 99 | __put_user(offset, &dirent->d_offset) || |
| 100 | __put_user(namlen, &dirent->d_namlen) || |
| 101 | __copy_to_user(dirent->d_name, name, namlen) || |
| 102 | __put_user(0, dirent->d_name + namlen)) |
| 103 | goto efault; |
| 104 | return 0; |
| 105 | efault: |
| 106 | buf->result = -EFAULT; |
| 107 | return -EFAULT; |
| 108 | } |
| 109 | |
Heiko Carstens | d4e8204 | 2009-01-14 14:14:34 +0100 | [diff] [blame] | 110 | SYSCALL_DEFINE3(old_readdir, unsigned int, fd, |
| 111 | struct old_linux_dirent __user *, dirent, unsigned int, count) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 112 | { |
| 113 | int error; |
Al Viro | 2903ff0 | 2012-08-28 12:52:22 -0400 | [diff] [blame] | 114 | struct fd f = fdget(fd); |
Al Viro | ac6614b | 2013-05-22 22:22:04 -0400 | [diff] [blame] | 115 | struct readdir_callback buf = { |
| 116 | .ctx.actor = fillonedir, |
| 117 | .dirent = dirent |
| 118 | }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 119 | |
Al Viro | 2903ff0 | 2012-08-28 12:52:22 -0400 | [diff] [blame] | 120 | if (!f.file) |
Al Viro | 863ced7 | 2012-04-21 18:40:32 -0400 | [diff] [blame] | 121 | return -EBADF; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 122 | |
Al Viro | 5c0ba4e | 2013-05-15 13:52:59 -0400 | [diff] [blame] | 123 | error = iterate_dir(f.file, &buf.ctx); |
Al Viro | 53c9c5c | 2008-08-24 07:29:52 -0400 | [diff] [blame] | 124 | if (buf.result) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 125 | error = buf.result; |
| 126 | |
Al Viro | 2903ff0 | 2012-08-28 12:52:22 -0400 | [diff] [blame] | 127 | fdput(f); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 128 | return error; |
| 129 | } |
| 130 | |
| 131 | #endif /* __ARCH_WANT_OLD_READDIR */ |
| 132 | |
| 133 | /* |
| 134 | * New, all-improved, singing, dancing, iBCS2-compliant getdents() |
| 135 | * interface. |
| 136 | */ |
| 137 | struct linux_dirent { |
| 138 | unsigned long d_ino; |
| 139 | unsigned long d_off; |
| 140 | unsigned short d_reclen; |
| 141 | char d_name[1]; |
| 142 | }; |
| 143 | |
| 144 | struct getdents_callback { |
Al Viro | 5c0ba4e | 2013-05-15 13:52:59 -0400 | [diff] [blame] | 145 | struct dir_context ctx; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 146 | struct linux_dirent __user * current_dir; |
| 147 | struct linux_dirent __user * previous; |
| 148 | int count; |
| 149 | int error; |
| 150 | }; |
| 151 | |
Miklos Szeredi | ac7576f | 2014-10-30 17:37:34 +0100 | [diff] [blame] | 152 | static int filldir(struct dir_context *ctx, const char *name, int namlen, |
| 153 | loff_t offset, u64 ino, unsigned int d_type) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 154 | { |
| 155 | struct linux_dirent __user * dirent; |
Miklos Szeredi | ac7576f | 2014-10-30 17:37:34 +0100 | [diff] [blame] | 156 | struct getdents_callback *buf = |
| 157 | container_of(ctx, struct getdents_callback, ctx); |
David Howells | afefdbb | 2006-10-03 01:13:46 -0700 | [diff] [blame] | 158 | unsigned long d_ino; |
Kevin Winchester | 85c9fe8 | 2010-08-09 17:20:22 -0700 | [diff] [blame] | 159 | int reclen = ALIGN(offsetof(struct linux_dirent, d_name) + namlen + 2, |
| 160 | sizeof(long)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 161 | |
| 162 | buf->error = -EINVAL; /* only used if we fail.. */ |
| 163 | if (reclen > buf->count) |
| 164 | return -EINVAL; |
David Howells | afefdbb | 2006-10-03 01:13:46 -0700 | [diff] [blame] | 165 | d_ino = ino; |
Al Viro | 8f3f655 | 2008-08-12 00:28:24 -0400 | [diff] [blame] | 166 | if (sizeof(d_ino) < sizeof(ino) && d_ino != ino) { |
| 167 | buf->error = -EOVERFLOW; |
David Howells | afefdbb | 2006-10-03 01:13:46 -0700 | [diff] [blame] | 168 | return -EOVERFLOW; |
Al Viro | 8f3f655 | 2008-08-12 00:28:24 -0400 | [diff] [blame] | 169 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 170 | dirent = buf->previous; |
| 171 | if (dirent) { |
Theodore Ts'o | 1f60fbe | 2016-04-23 22:50:07 -0400 | [diff] [blame^] | 172 | if (signal_pending(current)) |
| 173 | return -EINTR; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 174 | if (__put_user(offset, &dirent->d_off)) |
| 175 | goto efault; |
| 176 | } |
| 177 | dirent = buf->current_dir; |
David Howells | afefdbb | 2006-10-03 01:13:46 -0700 | [diff] [blame] | 178 | if (__put_user(d_ino, &dirent->d_ino)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 179 | goto efault; |
| 180 | if (__put_user(reclen, &dirent->d_reclen)) |
| 181 | goto efault; |
| 182 | if (copy_to_user(dirent->d_name, name, namlen)) |
| 183 | goto efault; |
| 184 | if (__put_user(0, dirent->d_name + namlen)) |
| 185 | goto efault; |
| 186 | if (__put_user(d_type, (char __user *) dirent + reclen - 1)) |
| 187 | goto efault; |
| 188 | buf->previous = dirent; |
| 189 | dirent = (void __user *)dirent + reclen; |
| 190 | buf->current_dir = dirent; |
| 191 | buf->count -= reclen; |
| 192 | return 0; |
| 193 | efault: |
| 194 | buf->error = -EFAULT; |
| 195 | return -EFAULT; |
| 196 | } |
| 197 | |
Heiko Carstens | 20f3703 | 2009-01-14 14:14:23 +0100 | [diff] [blame] | 198 | SYSCALL_DEFINE3(getdents, unsigned int, fd, |
| 199 | struct linux_dirent __user *, dirent, unsigned int, count) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 200 | { |
Al Viro | 2903ff0 | 2012-08-28 12:52:22 -0400 | [diff] [blame] | 201 | struct fd f; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 202 | struct linux_dirent __user * lastdirent; |
Al Viro | ac6614b | 2013-05-22 22:22:04 -0400 | [diff] [blame] | 203 | struct getdents_callback buf = { |
| 204 | .ctx.actor = filldir, |
| 205 | .count = count, |
| 206 | .current_dir = dirent |
| 207 | }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 208 | int error; |
| 209 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 210 | if (!access_ok(VERIFY_WRITE, dirent, count)) |
Al Viro | 863ced7 | 2012-04-21 18:40:32 -0400 | [diff] [blame] | 211 | return -EFAULT; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 212 | |
Al Viro | 2903ff0 | 2012-08-28 12:52:22 -0400 | [diff] [blame] | 213 | f = fdget(fd); |
| 214 | if (!f.file) |
Al Viro | 863ced7 | 2012-04-21 18:40:32 -0400 | [diff] [blame] | 215 | return -EBADF; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 216 | |
Al Viro | 5c0ba4e | 2013-05-15 13:52:59 -0400 | [diff] [blame] | 217 | error = iterate_dir(f.file, &buf.ctx); |
Al Viro | 53c9c5c | 2008-08-24 07:29:52 -0400 | [diff] [blame] | 218 | if (error >= 0) |
| 219 | error = buf.error; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 220 | lastdirent = buf.previous; |
| 221 | if (lastdirent) { |
Al Viro | bb6f619 | 2013-05-15 18:49:12 -0400 | [diff] [blame] | 222 | if (put_user(buf.ctx.pos, &lastdirent->d_off)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 223 | error = -EFAULT; |
| 224 | else |
| 225 | error = count - buf.count; |
| 226 | } |
Al Viro | 2903ff0 | 2012-08-28 12:52:22 -0400 | [diff] [blame] | 227 | fdput(f); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 228 | return error; |
| 229 | } |
| 230 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 231 | struct getdents_callback64 { |
Al Viro | 5c0ba4e | 2013-05-15 13:52:59 -0400 | [diff] [blame] | 232 | struct dir_context ctx; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 233 | struct linux_dirent64 __user * current_dir; |
| 234 | struct linux_dirent64 __user * previous; |
| 235 | int count; |
| 236 | int error; |
| 237 | }; |
| 238 | |
Miklos Szeredi | ac7576f | 2014-10-30 17:37:34 +0100 | [diff] [blame] | 239 | static int filldir64(struct dir_context *ctx, const char *name, int namlen, |
| 240 | loff_t offset, u64 ino, unsigned int d_type) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 241 | { |
| 242 | struct linux_dirent64 __user *dirent; |
Miklos Szeredi | ac7576f | 2014-10-30 17:37:34 +0100 | [diff] [blame] | 243 | struct getdents_callback64 *buf = |
| 244 | container_of(ctx, struct getdents_callback64, ctx); |
Kevin Winchester | 85c9fe8 | 2010-08-09 17:20:22 -0700 | [diff] [blame] | 245 | int reclen = ALIGN(offsetof(struct linux_dirent64, d_name) + namlen + 1, |
| 246 | sizeof(u64)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 247 | |
| 248 | buf->error = -EINVAL; /* only used if we fail.. */ |
| 249 | if (reclen > buf->count) |
| 250 | return -EINVAL; |
| 251 | dirent = buf->previous; |
| 252 | if (dirent) { |
Theodore Ts'o | 1f60fbe | 2016-04-23 22:50:07 -0400 | [diff] [blame^] | 253 | if (signal_pending(current)) |
| 254 | return -EINTR; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 255 | if (__put_user(offset, &dirent->d_off)) |
| 256 | goto efault; |
| 257 | } |
| 258 | dirent = buf->current_dir; |
| 259 | if (__put_user(ino, &dirent->d_ino)) |
| 260 | goto efault; |
| 261 | if (__put_user(0, &dirent->d_off)) |
| 262 | goto efault; |
| 263 | if (__put_user(reclen, &dirent->d_reclen)) |
| 264 | goto efault; |
| 265 | if (__put_user(d_type, &dirent->d_type)) |
| 266 | goto efault; |
| 267 | if (copy_to_user(dirent->d_name, name, namlen)) |
| 268 | goto efault; |
| 269 | if (__put_user(0, dirent->d_name + namlen)) |
| 270 | goto efault; |
| 271 | buf->previous = dirent; |
| 272 | dirent = (void __user *)dirent + reclen; |
| 273 | buf->current_dir = dirent; |
| 274 | buf->count -= reclen; |
| 275 | return 0; |
| 276 | efault: |
| 277 | buf->error = -EFAULT; |
| 278 | return -EFAULT; |
| 279 | } |
| 280 | |
Heiko Carstens | 20f3703 | 2009-01-14 14:14:23 +0100 | [diff] [blame] | 281 | SYSCALL_DEFINE3(getdents64, unsigned int, fd, |
| 282 | struct linux_dirent64 __user *, dirent, unsigned int, count) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 283 | { |
Al Viro | 2903ff0 | 2012-08-28 12:52:22 -0400 | [diff] [blame] | 284 | struct fd f; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 285 | struct linux_dirent64 __user * lastdirent; |
Al Viro | ac6614b | 2013-05-22 22:22:04 -0400 | [diff] [blame] | 286 | struct getdents_callback64 buf = { |
| 287 | .ctx.actor = filldir64, |
| 288 | .count = count, |
| 289 | .current_dir = dirent |
| 290 | }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 291 | int error; |
| 292 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 293 | if (!access_ok(VERIFY_WRITE, dirent, count)) |
Al Viro | 863ced7 | 2012-04-21 18:40:32 -0400 | [diff] [blame] | 294 | return -EFAULT; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 295 | |
Al Viro | 2903ff0 | 2012-08-28 12:52:22 -0400 | [diff] [blame] | 296 | f = fdget(fd); |
| 297 | if (!f.file) |
Al Viro | 863ced7 | 2012-04-21 18:40:32 -0400 | [diff] [blame] | 298 | return -EBADF; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 299 | |
Al Viro | 5c0ba4e | 2013-05-15 13:52:59 -0400 | [diff] [blame] | 300 | error = iterate_dir(f.file, &buf.ctx); |
Al Viro | 53c9c5c | 2008-08-24 07:29:52 -0400 | [diff] [blame] | 301 | if (error >= 0) |
| 302 | error = buf.error; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 303 | lastdirent = buf.previous; |
| 304 | if (lastdirent) { |
Al Viro | bb6f619 | 2013-05-15 18:49:12 -0400 | [diff] [blame] | 305 | typeof(lastdirent->d_off) d_off = buf.ctx.pos; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 306 | if (__put_user(d_off, &lastdirent->d_off)) |
Al Viro | 53c9c5c | 2008-08-24 07:29:52 -0400 | [diff] [blame] | 307 | error = -EFAULT; |
| 308 | else |
| 309 | error = count - buf.count; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 310 | } |
Al Viro | 2903ff0 | 2012-08-28 12:52:22 -0400 | [diff] [blame] | 311 | fdput(f); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 312 | return error; |
| 313 | } |