lkml.org 
[lkml]   [2012]   [Sep]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[ 035/218] vfs: make O PATH file descriptors usable for fstat()
    Date
    3.4-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Linus Torvalds <torvalds@linux-foundation.org>

    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>

    ---
    fs/stat.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    --- a/fs/stat.c
    +++ b/fs/stat.c
    @@ -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) {

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2012-09-29 02:01    [W:2.120 / U:0.292 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site