[03/14] NFSv4: nfs4_callback_getattr() should ignore revoked delegations
diff mbox series

Message ID 20191023235600.10880-4-trond.myklebust@hammerspace.com
State New
Headers show
Series
  • Delegation bugfixes
Related show

Commit Message

Trond Myklebust Oct. 23, 2019, 11:55 p.m. UTC
If the delegation has been revoked, ignore it.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
---
 fs/nfs/callback_proc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c
index db3e7771e597..58a77c41ff36 100644
--- a/fs/nfs/callback_proc.c
+++ b/fs/nfs/callback_proc.c
@@ -50,7 +50,7 @@  __be32 nfs4_callback_getattr(void *argp, void *resp,
 	nfsi = NFS_I(inode);
 	rcu_read_lock();
 	delegation = rcu_dereference(nfsi->delegation);
-	if (delegation == NULL || (delegation->type & FMODE_WRITE) == 0)
+	if (!nfs4_is_valid_delegation(delegation, FMODE_WRITE))
 		goto out_iput;
 	res->size = i_size_read(inode);
 	res->change_attr = delegation->change_attr;