Skip to content

Commit

Permalink
vfs: make O_PATH file descriptors usable for 'fstat()'
Browse files Browse the repository at this point in the history
commit 55815f7 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 332a2e1, 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: Ben Hutchings <ben@decadent.org.uk>
  • Loading branch information
Linus Torvalds authored and Ben Hutchings committed Sep 19, 2012
1 parent 7c6430b commit d228dd2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/stat.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ EXPORT_SYMBOL(vfs_getattr);
int vfs_fstat(unsigned int fd, struct kstat *stat)
{
int fput_needed;
struct file *f = fget_light(fd, &fput_needed);
struct file *f = fget_raw_light(fd, &fput_needed);
int error = -EBADF;

if (f) {
Expand Down

0 comments on commit d228dd2

Please sign in to comment.