• E
    vfs: Don't let __fdget_pos() get FMODE_PATH files · 99aea681
    Eric Biggers 提交于
    Commit bd2a31d5 ("get rid of fget_light()") introduced the
    __fdget_pos() function, which returns the resulting file pointer and
    fdput flags combined in an 'unsigned long'.  However, it also changed the
    behavior to return files with FMODE_PATH set, which shouldn't happen
    because read(), write(), lseek(), etc. aren't allowed on such files.
    This commit restores the old behavior.
    
    This regression actually had no effect on read() and write() since
    FMODE_READ and FMODE_WRITE are not set on file descriptors opened with
    O_PATH, but it did cause lseek() on a file descriptor opened with O_PATH
    to fail with ESPIPE rather than EBADF.
    Signed-off-by: NEric Biggers <ebiggers3@gmail.com>
    Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
    99aea681
file.c 21.6 KB