summaryrefslogtreecommitdiff
path: root/fs/nfs/delegation.c
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@hammerspace.com>2019-10-21 14:11:00 -0400
committerTrond Myklebust <trond.myklebust@hammerspace.com>2019-11-03 21:28:45 -0500
commite0f07896affd27ec378857dd6fccad0a43e52d35 (patch)
tree3c599da9f8cb6100d391da209cf6d8ab7617e232 /fs/nfs/delegation.c
parentf9e0cc9c97906ede17ca5cd56a7b170830f4369a (diff)
downloadlwn-e0f07896affd27ec378857dd6fccad0a43e52d35.tar.gz
lwn-e0f07896affd27ec378857dd6fccad0a43e52d35.zip
NFSv4: Hold the delegation spinlock when updating the seqid
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to 'fs/nfs/delegation.c')
-rw-r--r--fs/nfs/delegation.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c
index e80419a63fb5..7ebeb57cb597 100644
--- a/fs/nfs/delegation.c
+++ b/fs/nfs/delegation.c
@@ -387,8 +387,10 @@ int nfs_inode_set_delegation(struct inode *inode, const struct cred *cred,
/* Is this an update of the existing delegation? */
if (nfs4_stateid_match_other(&old_delegation->stateid,
&delegation->stateid)) {
+ spin_lock(&old_delegation->lock);
nfs_update_inplace_delegation(old_delegation,
delegation);
+ spin_unlock(&old_delegation->lock);
goto out;
}
/*