diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-09-14 14:48:21 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-10-02 09:47:23 -0700 |
commit | c168d49dbb4bc6cbd58b855166e5f98585479307 (patch) | |
tree | 684d05c948b6fd60044934bddb8a6013e9f55f07 /fs/stat.c | |
parent | cf8d67a69224bc2fbc6bc395cf639a9b0652c8e3 (diff) | |
download | kernel_samsung_tuna-c168d49dbb4bc6cbd58b855166e5f98585479307.zip kernel_samsung_tuna-c168d49dbb4bc6cbd58b855166e5f98585479307.tar.gz kernel_samsung_tuna-c168d49dbb4bc6cbd58b855166e5f98585479307.tar.bz2 |
vfs: make O_PATH file descriptors usable for 'fstat()'
commit 55815f70147dcfa3ead5738fd56d3574e2e3c1c2 upstream.
We already use them for openat() and friends, but fstat() also wants to
be able to use O_PATH file descriptors. This should make it more
directly comparable to the O_SEARCH of Solaris.
Note that you could already do the same thing with "fstatat()" and an
empty path, but just doing "fstat()" directly is simpler and faster, so
there is no reason not to just allow it directly.
See also commit 332a2e1244bd, which did the same thing for fchdir, for
the same reasons.
Reported-by: ольга крыжановская <olga.kryzhanovska@gmail.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/stat.c')
-rw-r--r-- | fs/stat.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -57,7 +57,7 @@ EXPORT_SYMBOL(vfs_getattr); int vfs_fstat(unsigned int fd, struct kstat *stat) { - struct file *f = fget(fd); + struct file *f = fget_raw(fd); int error = -EBADF; if (f) { |