aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/delegation.h
diff options
context:
space:
mode:
authorTrond Myklebust <trondmy@gmail.com>2020-02-13 14:51:06 -0500
committerAnna Schumaker <Anna.Schumaker@Netapp.com>2020-02-13 16:18:50 -0500
commit8c75593c6eee0f661ddf25dfde0e6ad2a84be7a9 (patch)
treeb4af6d59d60f5e555082220cdde1798610e5dff9 /fs/nfs/delegation.h
parentNFSv4.1 make cachethis=no for writes (diff)
downloadlinux-dev-8c75593c6eee0f661ddf25dfde0e6ad2a84be7a9.tar.xz
linux-dev-8c75593c6eee0f661ddf25dfde0e6ad2a84be7a9.zip
NFSv4: Ensure the delegation is pinned in nfs_do_return_delegation()
The call to nfs_do_return_delegation() needs to be taken without any RCU locks. Add a refcount to make sure the delegation remains pinned in memory until we're done. Fixes: ee05f456772d ("NFSv4: Fix races between open and delegreturn") Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'fs/nfs/delegation.h')
-rw-r--r--fs/nfs/delegation.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/nfs/delegation.h b/fs/nfs/delegation.h
index 31b84604d383..9b00a0b7f832 100644
--- a/fs/nfs/delegation.h
+++ b/fs/nfs/delegation.h
@@ -22,6 +22,7 @@ struct nfs_delegation {
unsigned long pagemod_limit;
__u64 change_attr;
unsigned long flags;
+ refcount_t refcount;
spinlock_t lock;
struct rcu_head rcu;
};