summaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4_fs.h
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2013-10-17 20:14:10 +0200
committerTrond Myklebust <Trond.Myklebust@netapp.com>2013-10-28 20:31:55 +0100
commit0625c2dd6ae32a221871ffc04bb752216b823001 (patch)
treeade4401e23b075b947ca9d5453d2b538f37203a3 /fs/nfs/nfs4_fs.h
parentNFS: Set EXCHGID4_FLAG_SUPP_MOVED_MIGR (diff)
downloadlinux-0625c2dd6ae32a221871ffc04bb752216b823001.tar.xz
linux-0625c2dd6ae32a221871ffc04bb752216b823001.zip
NFS: Fix possible endless state recovery wait
In nfs4_wait_clnt_recover(), hold a reference to the clp being waited on. The state manager can reduce clp->cl_count to 1, in which case the nfs_put_client() in nfs4_run_state_manager() can free *clp before wait_on_bit() returns and allows nfs4_wait_clnt_recover() to run again. The behavior at that point is non-deterministic. If the waited-on bit still happens to be zero, wait_on_bit() will wake the waiter as expected. If the bit is set again (say, if the memory was poisoned when freed) wait_on_bit() can leave the waiter asleep. This is a narrow fix which ensures the safety of accessing *clp in nfs4_wait_clnt_recover(), but does not address the continued use of a possibly freed *clp after nfs4_wait_clnt_recover() returns (see nfs_end_delegation_return(), for example). Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4_fs.h')
0 files changed, 0 insertions, 0 deletions