Skip to content
  • Al Viro's avatar
    switch non-create side of open() to use of do_last() · fe2d35ff
    Al Viro authored
    
    
    Instead of path_lookupat() doing trailing symlink resolution,
    use the same scheme as on the O_CREAT side.  Walk with
    LOOKUP_PARENT, then (in do_last()) look the final component
    up, then either open it or return error or, if it's a symlink,
    give the symlink back to path_openat() to be resolved there.
    
    The really messy complication here is RCU.  We don't want to drop
    out of RCU mode before the final lookup, since we don't want to
    bounce parent directory ->d_count without a good reason.
    
    Result is _not_ pretty; later in the series we'll clean it up.
    For now we are roughly back where we'd been before the revert
    done by Nick's series - top-level logics of path_openat() is
    cleaned up, do_last() does actual opening, symlink resolution is
    done uniformly.
    
    Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
    fe2d35ff