]> git.baikalelectronics.ru Git - kernel.git/commit
nfsd: Detect unhashed stids in nfsd4_verify_open_stid()
authorTrond Myklebust <trond.myklebust@primarydata.com>
Fri, 12 Jan 2018 22:42:30 +0000 (17:42 -0500)
committerJ. Bruce Fields <bfields@redhat.com>
Mon, 5 Feb 2018 22:13:16 +0000 (17:13 -0500)
commita6c81f68c7ff215cd6d6db947dc9f53e437dcf04
treea29f5c6339d179a7975c76c221290c85137a193b
parent0e61c60f5c77e1ff2214b8056786c1f2de2f3828
nfsd: Detect unhashed stids in nfsd4_verify_open_stid()

The state of the stid is guaranteed by 2 locks:
- The nfs4_client 'cl_lock' spinlock
- The nfs4_ol_stateid 'st_mutex' mutex

so it is quite possible for the stid to be unhashed after lookup,
but before calling nfsd4_lock_ol_stateid(). So we do need to check
for a zero value for 'sc_type' in nfsd4_verify_open_stid().

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Tested-by: Checuk Lever <chuck.lever@oracle.com>
Cc: stable@vger.kernel.org
Fixes: 027e12f25642 "nfsd: Ensure we don't recognise lock stateids..."
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4state.c