OSDN Git Service

NFSv4: nfs4_callback_getattr() should ignore revoked delegations
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Tue, 22 Oct 2019 12:35:57 +0000 (08:35 -0400)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Mon, 4 Nov 2019 02:28:45 +0000 (21:28 -0500)
If the delegation has been revoked, ignore it.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/callback_proc.c

index db3e777..cd4c6bc 100644 (file)
@@ -26,7 +26,6 @@ __be32 nfs4_callback_getattr(void *argp, void *resp,
        struct cb_getattrargs *args = argp;
        struct cb_getattrres *res = resp;
        struct nfs_delegation *delegation;
-       struct nfs_inode *nfsi;
        struct inode *inode;
 
        res->status = htonl(NFS4ERR_OP_NOT_IN_SESSION);
@@ -47,9 +46,8 @@ __be32 nfs4_callback_getattr(void *argp, void *resp,
                                -ntohl(res->status));
                goto out;
        }
-       nfsi = NFS_I(inode);
        rcu_read_lock();
-       delegation = rcu_dereference(nfsi->delegation);
+       delegation = nfs4_get_valid_delegation(inode);
        if (delegation == NULL || (delegation->type & FMODE_WRITE) == 0)
                goto out_iput;
        res->size = i_size_read(inode);