Skip to content

Commit 0280e3c

Browse files
committed
Merge tag 'nfs-for-5.17-1' of git://git.linux-nfs.org/projects/anna/linux-nfs
Pull NFS client updates from Anna Schumaker: "New Features: - Basic handling for case insensitive filesystems - Initial support for fs_locations and server trunking Bugfixes and Cleanups: - Cleanups to how the "struct cred *" is handled for the nfs_access_entry - Ensure the server has an up to date ctimes before hardlinking or renaming - Update 'blocks used' after writeback, fallocate, and clone - nfs_atomic_open() fixes - Improvements to sunrpc tracing - Various null check & indenting related cleanups - Some improvements to the sunrpc sysfs code: - Use default_groups in kobj_type - Fix some potential races and reference leaks - A few tracepoint cleanups in xprtrdma" [ This should have gone in during the merge window, but didn't. The original pull request - sent during the merge window - had gotten marked as spam and discarded due missing DKIM headers in the email from Anna. - Linus ] * tag 'nfs-for-5.17-1' of git://git.linux-nfs.org/projects/anna/linux-nfs: (35 commits) SUNRPC: Don't dereference xprt->snd_task if it's a cookie xprtrdma: Remove definitions of RPCDBG_FACILITY xprtrdma: Remove final dprintk call sites from xprtrdma sunrpc: Fix potential race conditions in rpc_sysfs_xprt_state_change() net/sunrpc: fix reference count leaks in rpc_sysfs_xprt_state_change NFSv4.1 test and add 4.1 trunking transport SUNRPC allow for unspecified transport time in rpc_clnt_add_xprt NFSv4 handle port presence in fs_location server string NFSv4 expose nfs_parse_server_name function NFSv4.1 query for fs_location attr on a new file system NFSv4 store server support for fs_location attribute NFSv4 remove zero number of fs_locations entries error check NFSv4: nfs_atomic_open() can race when looking up a non-regular file NFSv4: Handle case where the lookup of a directory fails NFSv42: Fallocate and clone should also request 'blocks used' NFSv4: Allow writebacks to request 'blocks used' SUNRPC: use default_groups in kobj_type NFS: use default_groups in kobj_type NFS: Fix the verifier for case sensitive filesystem in nfs_atomic_open() NFS: Add a helper to remove case-insensitive aliases ...
2 parents 7938d61 + aed28b7 commit 0280e3c

30 files changed

+474
-207
lines changed

fs/nfs/callback.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ struct cb_devicenotifyitem {
170170
};
171171

172172
struct cb_devicenotifyargs {
173-
int ndevs;
173+
uint32_t ndevs;
174174
struct cb_devicenotifyitem *devs;
175175
};
176176

fs/nfs/callback_proc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ __be32 nfs4_callback_devicenotify(void *argp, void *resp,
358358
struct cb_process_state *cps)
359359
{
360360
struct cb_devicenotifyargs *args = argp;
361-
int i;
361+
uint32_t i;
362362
__be32 res = 0;
363363
struct nfs_client *clp = cps->clp;
364364
struct nfs_server *server = NULL;

fs/nfs/callback_xdr.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -258,11 +258,9 @@ __be32 decode_devicenotify_args(struct svc_rqst *rqstp,
258258
void *argp)
259259
{
260260
struct cb_devicenotifyargs *args = argp;
261+
uint32_t tmp, n, i;
261262
__be32 *p;
262263
__be32 status = 0;
263-
u32 tmp;
264-
int n, i;
265-
args->ndevs = 0;
266264

267265
/* Num of device notifications */
268266
p = xdr_inline_decode(xdr, sizeof(uint32_t));
@@ -271,7 +269,7 @@ __be32 decode_devicenotify_args(struct svc_rqst *rqstp,
271269
goto out;
272270
}
273271
n = ntohl(*p++);
274-
if (n <= 0)
272+
if (n == 0)
275273
goto out;
276274
if (n > ULONG_MAX / sizeof(*args->devs)) {
277275
status = htonl(NFS4ERR_BADXDR);
@@ -330,19 +328,21 @@ __be32 decode_devicenotify_args(struct svc_rqst *rqstp,
330328
dev->cbd_immediate = 0;
331329
}
332330

333-
args->ndevs++;
334-
335331
dprintk("%s: type %d layout 0x%x immediate %d\n",
336332
__func__, dev->cbd_notify_type, dev->cbd_layout_type,
337333
dev->cbd_immediate);
338334
}
335+
args->ndevs = n;
336+
dprintk("%s: ndevs %d\n", __func__, args->ndevs);
337+
return 0;
338+
err:
339+
kfree(args->devs);
339340
out:
341+
args->devs = NULL;
342+
args->ndevs = 0;
340343
dprintk("%s: status %d ndevs %d\n",
341344
__func__, ntohl(status), args->ndevs);
342345
return status;
343-
err:
344-
kfree(args->devs);
345-
goto out;
346346
}
347347

348348
static __be32 decode_sessionid(struct xdr_stream *xdr,

fs/nfs/client.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -856,6 +856,13 @@ static int nfs_probe_fsinfo(struct nfs_server *server, struct nfs_fh *mntfh, str
856856
server->namelen = pathinfo.max_namelen;
857857
}
858858

859+
if (clp->rpc_ops->discover_trunking != NULL &&
860+
(server->caps & NFS_CAP_FS_LOCATIONS)) {
861+
error = clp->rpc_ops->discover_trunking(server, mntfh);
862+
if (error < 0)
863+
return error;
864+
}
865+
859866
return 0;
860867
}
861868

0 commit comments

Comments
 (0)