summaryrefslogtreecommitdiff
path: root/fs/nfs/delegation.c
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@hammerspace.com>2019-10-21 14:12:13 -0400
committerTrond Myklebust <trond.myklebust@hammerspace.com>2019-11-03 21:28:45 -0500
commitf9e0cc9c97906ede17ca5cd56a7b170830f4369a (patch)
treef47f96190049186f509fdd49f30468d3b5644453 /fs/nfs/delegation.c
parentb47e0e478c494a5e276f7d9b455b0f26bf33fc9c (diff)
downloadlwn-f9e0cc9c97906ede17ca5cd56a7b170830f4369a.tar.gz
lwn-f9e0cc9c97906ede17ca5cd56a7b170830f4369a.zip
NFSv4: Don't remove the delegation from the super_list more than once
Add a check to ensure that we haven't already removed the delegation from the inode after we take all the relevant locks. Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to 'fs/nfs/delegation.c')
-rw-r--r--fs/nfs/delegation.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c
index 0c9339d559f5..e80419a63fb5 100644
--- a/fs/nfs/delegation.c
+++ b/fs/nfs/delegation.c
@@ -298,6 +298,10 @@ nfs_detach_delegation_locked(struct nfs_inode *nfsi,
return NULL;
spin_lock(&delegation->lock);
+ if (!delegation->inode) {
+ spin_unlock(&delegation->lock);
+ return NULL;
+ }
set_bit(NFS_DELEGATION_RETURNING, &delegation->flags);
list_del_rcu(&delegation->super_list);
delegation->inode = NULL;