• J. Bruce Fields's avatar
    nfsd: don't fail unchecked creates of non-special files · 9dc4e6c4
    J. Bruce Fields authored
    Allow a v3 unchecked open of a non-regular file succeed as if it were a
    lookup; typically a client in such a case will want to fall back on a
    local open, so succeeding and giving it the filehandle is more useful
    than failing with nfserr_exist, which makes it appear that nothing at
    all exists by that name.
    
    Similarly for v4, on an open-create, return the same errors we would on
    an attempt to open a non-regular file, instead of returning
    nfserr_exist.
    
    This fixes a problem found doing a v4 open of a symlink with
    O_RDONLY|O_CREAT, which resulted in the current client returning EEXIST.
    
    Thanks also to Trond for analysis.
    
    Cc: stable@kernel.org
    Reported-by: default avatarOrion Poplawski <orion@cora.nwra.com>
    Tested-by: default avatarOrion Poplawski <orion@cora.nwra.com>
    Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
    9dc4e6c4
vfs.c 54.3 KB