From: Trond Myklebust <trondmy@gmail.com>
Date: Mon, 27 Jan 2020 14:58:15 +0000 (-0500)
Subject: NFSv4: nfs_inode_evict_delegation() should set NFS_DELEGATION_RETURNING
X-Git-Tag: v5.6-rc1~29^2~14
X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=f885ea640d65d98c8f1a326efb3abe13f1865c89;p=users%2Fjedix%2Flinux-maple.git

NFSv4: nfs_inode_evict_delegation() should set NFS_DELEGATION_RETURNING

In particular, the pnfs return-on-close code will check for that flag,
so ensure we set it appropriately.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
---

diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c
index fe57b2b5314a..a7e42725c3b1 100644
--- a/fs/nfs/delegation.c
+++ b/fs/nfs/delegation.c
@@ -607,6 +607,7 @@ void nfs_inode_evict_delegation(struct inode *inode)
 
 	delegation = nfs_inode_detach_delegation(inode);
 	if (delegation != NULL) {
+		set_bit(NFS_DELEGATION_RETURNING, &delegation->flags);
 		set_bit(NFS_DELEGATION_INODE_FREEING, &delegation->flags);
 		nfs_do_return_delegation(inode, delegation, 1);
 		nfs_free_delegation(delegation);