• Andrew Elble's avatar
    nfsd: fix race with open / open upgrade stateids · 7fc0564e
    Andrew Elble authored
    We observed multiple open stateids on the server for files that
    seemingly should have been closed.
    
    nfsd4_process_open2() tests for the existence of a preexisting
    stateid. If one is not found, the locks are dropped and a new
    one is created. The problem is that init_open_stateid(), which
    is also responsible for hashing the newly initialized stateid,
    doesn't check to see if another open has raced in and created
    a matching stateid. This fix is to enable init_open_stateid() to
    return the matching stateid and have nfsd4_process_open2()
    swap to that stateid and switch to the open upgrade path.
    In testing this patch, coverage to the newly created
    path indicates that the race was indeed happening.
    Signed-off-by: default avatarAndrew Elble <aweits@rit.edu>
    Reviewed-by: default avatarJeff Layton <jlayton@poochiereds.net>
    Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
    7fc0564e
Name
Last commit
Last update
..
Kconfig Loading commit data...
Makefile Loading commit data...
acl.h Loading commit data...
auth.c Loading commit data...
auth.h Loading commit data...
blocklayout.c Loading commit data...
blocklayoutxdr.c Loading commit data...
blocklayoutxdr.h Loading commit data...
cache.h Loading commit data...
current_stateid.h Loading commit data...
export.c Loading commit data...
export.h Loading commit data...
fault_inject.c Loading commit data...
idmap.h Loading commit data...
lockd.c Loading commit data...
netns.h Loading commit data...
nfs2acl.c Loading commit data...
nfs3acl.c Loading commit data...
nfs3proc.c Loading commit data...
nfs3xdr.c Loading commit data...
nfs4acl.c Loading commit data...
nfs4callback.c Loading commit data...
nfs4idmap.c Loading commit data...
nfs4layouts.c Loading commit data...
nfs4proc.c Loading commit data...
nfs4recover.c Loading commit data...
nfs4state.c Loading commit data...
nfs4xdr.c Loading commit data...
nfscache.c Loading commit data...
nfsctl.c Loading commit data...
nfsd.h Loading commit data...
nfsfh.c Loading commit data...
nfsfh.h Loading commit data...
nfsproc.c Loading commit data...
nfssvc.c Loading commit data...
nfsxdr.c Loading commit data...
pnfs.h Loading commit data...
state.h Loading commit data...
stats.c Loading commit data...
stats.h Loading commit data...
trace.c Loading commit data...
trace.h Loading commit data...
vfs.c Loading commit data...
vfs.h Loading commit data...
xdr.h Loading commit data...
xdr3.h Loading commit data...
xdr4.h Loading commit data...
xdr4cb.h Loading commit data...