linux/fs/nfsd
Andrew Elble 7fc0564e3a nfsd: fix race with open / open upgrade stateids
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: Andrew Elble <aweits@rit.edu>
Reviewed-by: Jeff Layton <jlayton@poochiereds.net>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
2015-11-10 09:29:45 -05:00
..
acl.h
auth.c
auth.h
blocklayout.c
blocklayoutxdr.c
blocklayoutxdr.h
cache.h
current_stateid.h
export.c
export.h
fault_inject.c
idmap.h
Kconfig
lockd.c
Makefile
netns.h
nfs2acl.c
nfs3acl.c
nfs3proc.c
nfs3xdr.c nfsd: switch unsigned char flags in svc_fh to bools 2015-10-12 17:31:04 -04:00
nfs4acl.c
nfs4callback.c
nfs4idmap.c
nfs4layouts.c nfsd: ensure that seqid morphing operations are atomic wrt to copies 2015-10-23 15:57:33 -04:00
nfs4proc.c nfsd: serialize layout stateid morphing operations 2015-10-23 15:57:32 -04:00
nfs4recover.c
nfs4state.c nfsd: fix race with open / open upgrade stateids 2015-11-10 09:29:45 -05:00
nfs4xdr.c
nfscache.c nfsd: remove recurring workqueue job to clean DRC 2015-11-10 09:25:51 -05:00
nfsctl.c
nfsd.h
nfsfh.c nfsd: switch unsigned char flags in svc_fh to bools 2015-10-12 17:31:04 -04:00
nfsfh.h nfsd: switch unsigned char flags in svc_fh to bools 2015-10-12 17:31:04 -04:00
nfsproc.c
nfssvc.c
nfsxdr.c
pnfs.h
state.h nfsd: ensure that seqid morphing operations are atomic wrt to copies 2015-10-23 15:57:33 -04:00
stats.c
stats.h
trace.c nfsd: move include of state.h from trace.c to trace.h 2015-10-23 15:57:29 -04:00
trace.h nfsd: move include of state.h from trace.c to trace.h 2015-10-23 15:57:29 -04:00
vfs.c nfsd: switch unsigned char flags in svc_fh to bools 2015-10-12 17:31:04 -04:00
vfs.h nfsd: switch unsigned char flags in svc_fh to bools 2015-10-12 17:31:04 -04:00
xdr.h
xdr3.h
xdr4.h nfsd: switch unsigned char flags in svc_fh to bools 2015-10-12 17:31:04 -04:00
xdr4cb.h