hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/fs/nfs/proc.c
....@@ -108,10 +108,15 @@
108108 .rpc_resp = fattr,
109109 };
110110 int status;
111
+ unsigned short task_flags = 0;
112
+
113
+ /* Is this is an attribute revalidation, subject to softreval? */
114
+ if (inode && (server->flags & NFS_MOUNT_SOFTREVAL))
115
+ task_flags |= RPC_TASK_TIMEOUT;
111116
112117 dprintk("NFS call getattr\n");
113118 nfs_fattr_init(fattr);
114
- status = rpc_call_sync(server->client, &msg, 0);
119
+ status = rpc_call_sync(server->client, &msg, task_flags);
115120 dprintk("NFS reply getattr: %d\n", status);
116121 return status;
117122 }
....@@ -147,14 +152,14 @@
147152 }
148153
149154 static int
150
-nfs_proc_lookup(struct inode *dir, const struct qstr *name,
155
+nfs_proc_lookup(struct inode *dir, struct dentry *dentry,
151156 struct nfs_fh *fhandle, struct nfs_fattr *fattr,
152157 struct nfs4_label *label)
153158 {
154159 struct nfs_diropargs arg = {
155160 .fh = NFS_FH(dir),
156
- .name = name->name,
157
- .len = name->len
161
+ .name = dentry->d_name.name,
162
+ .len = dentry->d_name.len
158163 };
159164 struct nfs_diropok res = {
160165 .fh = fhandle,
....@@ -166,10 +171,15 @@
166171 .rpc_resp = &res,
167172 };
168173 int status;
174
+ unsigned short task_flags = 0;
169175
170
- dprintk("NFS call lookup %s\n", name->name);
176
+ /* Is this is an attribute revalidation, subject to softreval? */
177
+ if (nfs_lookup_is_soft_revalidate(dentry))
178
+ task_flags |= RPC_TASK_TIMEOUT;
179
+
180
+ dprintk("NFS call lookup %pd2\n", dentry);
171181 nfs_fattr_init(fattr);
172
- status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0);
182
+ status = rpc_call_sync(NFS_CLIENT(dir), &msg, task_flags);
173183 dprintk("NFS reply lookup: %d\n", status);
174184 return status;
175185 }
....@@ -490,7 +500,7 @@
490500 * from nfs_readdir by calling the decode_entry function directly.
491501 */
492502 static int
493
-nfs_proc_readdir(struct dentry *dentry, struct rpc_cred *cred,
503
+nfs_proc_readdir(struct dentry *dentry, const struct cred *cred,
494504 u64 cookie, struct page **pages, unsigned int count, bool plus)
495505 {
496506 struct inode *dir = d_inode(dentry);
....@@ -710,7 +720,7 @@
710720 .file_ops = &nfs_file_operations,
711721 .getroot = nfs_proc_get_root,
712722 .submount = nfs_submount,
713
- .try_mount = nfs_try_mount,
723
+ .try_get_tree = nfs_try_get_tree,
714724 .getattr = nfs_proc_getattr,
715725 .setattr = nfs_proc_setattr,
716726 .lookup = nfs_proc_lookup,