]> git.baikalelectronics.ru Git - kernel.git/commit
vfs: make O_PATH file descriptors usable for 'fstat()'
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 14 Sep 2012 21:48:21 +0000 (14:48 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 14 Sep 2012 21:48:21 +0000 (14:48 -0700)
commit6c3b4f5eed8c8eb110685cdfa60d0f7348c5503b
treecebd3be422d89121a0bbca0b27a3a6125a6f4833
parent3a7edbc160f326e5dd653806389cebd3ec2de73e
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 48dabe0b8260, 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>
Cc: stable@kernel.org # O_PATH introduced in 3.0+
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/stat.c