]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - fs/nfs/nfs3proc.c
Merge tag 'mac80211-for-net-2020-02-14' of git://git.kernel.org/pub/scm/linux/kernel...
[linux.git] / fs / nfs / nfs3proc.c
index 657041c3a03f6ffd8d4cccd829c6864d8bfa400a..a46d1d5d16d8b24abe7291e3dbd8c75ad9281324 100644 (file)
@@ -110,10 +110,15 @@ nfs3_proc_getattr(struct nfs_server *server, struct nfs_fh *fhandle,
                .rpc_resp       = fattr,
        };
        int     status;
+       unsigned short task_flags = 0;
+
+       /* Is this is an attribute revalidation, subject to softreval? */
+       if (inode && (server->flags & NFS_MOUNT_SOFTREVAL))
+               task_flags |= RPC_TASK_TIMEOUT;
 
        dprintk("NFS call  getattr\n");
        nfs_fattr_init(fattr);
-       status = rpc_call_sync(server->client, &msg, 0);
+       status = rpc_call_sync(server->client, &msg, task_flags);
        dprintk("NFS reply getattr: %d\n", status);
        return status;
 }
@@ -140,23 +145,23 @@ nfs3_proc_setattr(struct dentry *dentry, struct nfs_fattr *fattr,
        nfs_fattr_init(fattr);
        status = rpc_call_sync(NFS_CLIENT(inode), &msg, 0);
        if (status == 0) {
+               nfs_setattr_update_inode(inode, sattr, fattr);
                if (NFS_I(inode)->cache_validity & NFS_INO_INVALID_ACL)
                        nfs_zap_acl_cache(inode);
-               nfs_setattr_update_inode(inode, sattr, fattr);
        }
        dprintk("NFS reply setattr: %d\n", status);
        return status;
 }
 
 static int
-nfs3_proc_lookup(struct inode *dir, const struct qstr *name,
+nfs3_proc_lookup(struct inode *dir, struct dentry *dentry,
                 struct nfs_fh *fhandle, struct nfs_fattr *fattr,
                 struct nfs4_label *label)
 {
        struct nfs3_diropargs   arg = {
                .fh             = NFS_FH(dir),
-               .name           = name->name,
-               .len            = name->len
+               .name           = dentry->d_name.name,
+               .len            = dentry->d_name.len
        };
        struct nfs3_diropres    res = {
                .fh             = fhandle,
@@ -168,20 +173,25 @@ nfs3_proc_lookup(struct inode *dir, const struct qstr *name,
                .rpc_resp       = &res,
        };
        int                     status;
+       unsigned short task_flags = 0;
 
-       dprintk("NFS call  lookup %s\n", name->name);
+       /* Is this is an attribute revalidation, subject to softreval? */
+       if (nfs_lookup_is_soft_revalidate(dentry))
+               task_flags |= RPC_TASK_TIMEOUT;
+
+       dprintk("NFS call  lookup %pd2\n", dentry);
        res.dir_attr = nfs_alloc_fattr();
        if (res.dir_attr == NULL)
                return -ENOMEM;
 
        nfs_fattr_init(fattr);
-       status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0);
+       status = rpc_call_sync(NFS_CLIENT(dir), &msg, task_flags);
        nfs_refresh_inode(dir, res.dir_attr);
        if (status >= 0 && !(fattr->valid & NFS_ATTR_FATTR)) {
                msg.rpc_proc = &nfs3_procedures[NFS3PROC_GETATTR];
                msg.rpc_argp = fhandle;
                msg.rpc_resp = fattr;
-               status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0);
+               status = rpc_call_sync(NFS_CLIENT(dir), &msg, task_flags);
        }
        nfs_free_fattr(res.dir_attr);
        dprintk("NFS reply lookup: %d\n", status);