linux/fs/nfsd
Jeff Layton dd257933fa nfsd: don't return an unhashed lock stateid after taking mutex
nfsd4_lock will take the st_mutex before working with the stateid it
gets, but between the time when we drop the cl_lock and take the mutex,
the stateid could become unhashed (a'la FREE_STATEID). If that happens
the lock stateid returned to the client will be forgotten.

Fix this by first moving the st_mutex acquisition into
lookup_or_create_lock_state. Then, have it check to see if the lock
stateid is still hashed after taking the mutex. If it's not, then put
the stateid and try the find/create again.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Tested-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Cc: stable@vger.kernel.org # feb9dad5 nfsd: Always lock state exclusively.
Cc: stable@vger.kernel.org
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
2016-08-12 16:10:25 -04:00
..
acl.h
auth.c
auth.h
blocklayout.c Highlights: 2016-08-04 19:59:06 -04:00
blocklayoutxdr.c Highlights: 2016-08-04 19:59:06 -04:00
blocklayoutxdr.h
cache.h
current_stateid.h
export.c nfsd: allow nfsd to advertise multiple layout types 2016-07-15 15:31:32 -04:00
export.h nfsd: allow nfsd to advertise multiple layout types 2016-07-15 15:31:32 -04:00
fault_inject.c
flexfilelayout.c nfsd: Add a super simple flex file server 2016-07-13 15:40:48 -04:00
flexfilelayoutxdr.c nfsd: Add a super simple flex file server 2016-07-13 15:40:48 -04:00
flexfilelayoutxdr.h nfsd: Add a super simple flex file server 2016-07-13 15:40:48 -04:00
idmap.h
Kconfig xfs: abstract block export operations from nfsd layouts 2016-07-15 15:31:29 -04:00
lockd.c
Makefile nfsd: Add a super simple flex file server 2016-07-13 15:40:48 -04:00
netns.h
nfs2acl.c
nfs3acl.c nfsd: check permissions when setting ACLs 2016-06-24 12:11:52 -04:00
nfs3proc.c
nfs3xdr.c
nfs4acl.c
nfs4callback.c nfsd4/rpc: move backchannel create logic into rpc code 2016-06-15 10:32:25 -04:00
nfs4idmap.c
nfs4layouts.c nfsd: allow nfsd to advertise multiple layout types 2016-07-15 15:31:32 -04:00
nfs4proc.c nfsd: drop unnecessary MAY_EXEC check from create 2016-08-04 17:11:52 -04:00
nfs4recover.c
nfs4state.c nfsd: don't return an unhashed lock stateid after taking mutex 2016-08-12 16:10:25 -04:00
nfs4xdr.c nfsd: allow nfsd to advertise multiple layout types 2016-07-15 15:31:32 -04:00
nfscache.c
nfsctl.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace 2016-07-29 15:54:19 -07:00
nfsd.h nfsd: implement machine credential support for some operations 2016-07-13 15:32:47 -04:00
nfsfh.c nfsd: check d_can_lookup in fh_verify of directories 2016-08-04 17:11:48 -04:00
nfsfh.h
nfsproc.c nfsd: reorganize nfsd_create 2016-08-04 17:11:49 -04:00
nfssvc.c
nfsxdr.c nfsd: Fix some indent inconsistancy 2016-07-13 15:53:41 -04:00
pnfs.h nfsd: Add a super simple flex file server 2016-07-13 15:40:48 -04:00
state.h nfsd: implement machine credential support for some operations 2016-07-13 15:32:47 -04:00
stats.c
stats.h
trace.c
trace.h
vfs.c nfsd: fix dentry refcounting on create 2016-08-11 11:42:08 -04:00
vfs.h nfsd: reorganize nfsd_create 2016-08-04 17:11:49 -04:00
xdr3.h
xdr4.h nfsd: implement machine credential support for some operations 2016-07-13 15:32:47 -04:00
xdr4cb.h
xdr.h