Skip to content

Commit 9fdb10c

Browse files
Herrie82Tofee
authored andcommitted
vfs: make O_PATH file descriptors usable for fstat()
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent f543f25 commit 9fdb10c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎fs/stat.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ EXPORT_SYMBOL(vfs_getattr);
5757

5858
int vfs_fstat(unsigned int fd, struct kstat *stat)
5959
{
60-
struct file *f = fget(fd);
60+
struct file *f = fget_raw(fd);
6161
int error = -EBADF;
6262

6363
if (f) {

0 commit comments

Comments
 (0)