Skip to content

Commit 2c26b68

Browse files
committed
Merge tag 'nfsd-6.16' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux
Pull nfsd updates from Chuck Lever: "The marquee feature for this release is that the limit on the maximum rsize and wsize has been raised to 4MB. The default remains at 1MB, but risk-seeking administrators now have the ability to try larger I/O sizes with NFS clients that support them. Eventually the default setting will be increased when we have confidence that this change will not have negative impact. With v6.16, NFSD now has its own debugfs file system where we can add experimental features and make them available outside of our development community without impacting production deployments. The first experimental setting added is one that makes all NFS READ operations use vfs_iter_read() instead of the NFSD splice actor. The plan is to eventually retire the splice actor, as that will enable a number of new capabilities such as the use of struct bio_vec from the top to the bottom of the NFSD stack. Jeff Layton contributed a number of observability improvements. The use of dprintk() in a number of high-traffic code paths has been replaced with static trace points. This release sees the continuation of efforts to harden the NFSv4.2 COPY operation. Soon, the restriction on async COPY operations can be lifted. Many thanks to the contributors, reviewers, testers, and bug reporters who participated during the v6.16 development cycle" * tag 'nfsd-6.16' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux: (60 commits) xdrgen: Fix code generated for counted arrays SUNRPC: Bump the maximum payload size for the server NFSD: Add a "default" block size NFSD: Remove NFSSVC_MAXBLKSIZE_V2 macro NFSD: Remove NFSD_BUFSIZE sunrpc: Remove the RPCSVC_MAXPAGES macro svcrdma: Adjust the number of entries in svc_rdma_send_ctxt::sc_pages svcrdma: Adjust the number of entries in svc_rdma_recv_ctxt::rc_pages sunrpc: Adjust size of socket's receive page array dynamically SUNRPC: Remove svc_rqst :: rq_vec SUNRPC: Remove svc_fill_write_vector() NFSD: Use rqstp->rq_bvec in nfsd_iter_write() SUNRPC: Export xdr_buf_to_bvec() NFSD: De-duplicate the svc_fill_write_vector() call sites NFSD: Use rqstp->rq_bvec in nfsd_iter_read() sunrpc: Replace the rq_bvec array with dynamically-allocated memory sunrpc: Replace the rq_pages array with dynamically-allocated memory sunrpc: Remove backchannel check in svc_init_buffer() sunrpc: Add a helper to derive maxpages from sv_max_mesg svcrdma: Reduce the number of rdma_rw contexts per-QP ...
2 parents d87d738 + 425364d commit 2c26b68

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+848
-381
lines changed

.mailmap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,8 @@ Naveen N Rao <naveen@kernel.org> <naveen.n.rao@linux.vnet.ibm.com>
546546
Neeraj Upadhyay <neeraj.upadhyay@kernel.org> <quic_neeraju@quicinc.com>
547547
Neeraj Upadhyay <neeraj.upadhyay@kernel.org> <neeraju@codeaurora.org>
548548
Neil Armstrong <neil.armstrong@linaro.org> <narmstrong@baylibre.com>
549+
NeilBrown <neil@brown.name> <neilb@suse.de>
550+
NeilBrown <neil@brown.name> <neilb@cse.unsw.edu.au>
549551
Nguyen Anh Quynh <aquynh@gmail.com>
550552
Nicholas Piggin <npiggin@gmail.com> <npiggen@suse.de>
551553
Nicholas Piggin <npiggin@gmail.com> <npiggin@kernel.dk>

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13005,7 +13005,7 @@ W: http://kernelnewbies.org/KernelJanitors
1300513005
KERNEL NFSD, SUNRPC, AND LOCKD SERVERS
1300613006
M: Chuck Lever <chuck.lever@oracle.com>
1300713007
M: Jeff Layton <jlayton@kernel.org>
13008-
R: Neil Brown <neilb@suse.de>
13008+
R: NeilBrown <neil@brown.name>
1300913009
R: Olga Kornievskaia <okorniev@redhat.com>
1301013010
R: Dai Ngo <Dai.Ngo@oracle.com>
1301113011
R: Tom Talpey <tom@talpey.com>

fs/nfsd/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ config NFSD_V4
7777
select FS_POSIX_ACL
7878
select RPCSEC_GSS_KRB5
7979
select CRYPTO
80+
select CRYPTO_LIB_SHA256
8081
select CRYPTO_MD5
81-
select CRYPTO_SHA256
8282
select GRACE_PERIOD
8383
select NFS_V4_2_SSC_HELPER if NFS_V4_2
8484
help

fs/nfsd/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ nfsd-$(CONFIG_NFSD_BLOCKLAYOUT) += blocklayout.o blocklayoutxdr.o
2424
nfsd-$(CONFIG_NFSD_SCSILAYOUT) += blocklayout.o blocklayoutxdr.o
2525
nfsd-$(CONFIG_NFSD_FLEXFILELAYOUT) += flexfilelayout.o flexfilelayoutxdr.o
2626
nfsd-$(CONFIG_NFS_LOCALIO) += localio.o
27+
nfsd-$(CONFIG_DEBUG_FS) += debugfs.o
2728

2829

2930
.PHONY: xdrgen

fs/nfsd/debugfs.c

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
3+
#include <linux/debugfs.h>
4+
5+
#include "nfsd.h"
6+
7+
static struct dentry *nfsd_top_dir __read_mostly;
8+
9+
/*
10+
* /sys/kernel/debug/nfsd/disable-splice-read
11+
*
12+
* Contents:
13+
* %0: NFS READ is allowed to use page splicing
14+
* %1: NFS READ uses only iov iter read
15+
*
16+
* The default value of this setting is zero (page splicing is
17+
* allowed). This setting takes immediate effect for all NFS
18+
* versions, all exports, and in all NFSD net namespaces.
19+
*/
20+
21+
static int nfsd_dsr_get(void *data, u64 *val)
22+
{
23+
*val = nfsd_disable_splice_read ? 1 : 0;
24+
return 0;
25+
}
26+
27+
static int nfsd_dsr_set(void *data, u64 val)
28+
{
29+
nfsd_disable_splice_read = (val > 0) ? true : false;
30+
return 0;
31+
}
32+
33+
DEFINE_DEBUGFS_ATTRIBUTE(nfsd_dsr_fops, nfsd_dsr_get, nfsd_dsr_set, "%llu\n");
34+
35+
void nfsd_debugfs_exit(void)
36+
{
37+
debugfs_remove_recursive(nfsd_top_dir);
38+
nfsd_top_dir = NULL;
39+
}
40+
41+
void nfsd_debugfs_init(void)
42+
{
43+
nfsd_top_dir = debugfs_create_dir("nfsd", NULL);
44+
45+
debugfs_create_file("disable-splice-read", S_IWUSR | S_IRUGO,
46+
nfsd_top_dir, NULL, &nfsd_dsr_fops);
47+
}

fs/nfsd/export.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1124,7 +1124,8 @@ __be32 check_nfsd_access(struct svc_export *exp, struct svc_rqst *rqstp,
11241124
test_bit(XPT_PEER_AUTH, &xprt->xpt_flags))
11251125
goto ok;
11261126
}
1127-
goto denied;
1127+
if (!may_bypass_gss)
1128+
goto denied;
11281129

11291130
ok:
11301131
/* legacy gss-only clients are always OK: */

fs/nfsd/nfs3proc.c

Lines changed: 7 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "xdr3.h"
1515
#include "vfs.h"
1616
#include "filecache.h"
17+
#include "trace.h"
1718

1819
#define NFSDDBG_FACILITY NFSDDBG_PROC
1920

@@ -69,8 +70,7 @@ nfsd3_proc_getattr(struct svc_rqst *rqstp)
6970
struct nfsd_fhandle *argp = rqstp->rq_argp;
7071
struct nfsd3_attrstat *resp = rqstp->rq_resp;
7172

72-
dprintk("nfsd: GETATTR(3) %s\n",
73-
SVCFH_fmt(&argp->fh));
73+
trace_nfsd_vfs_getattr(rqstp, &argp->fh);
7474

7575
fh_copy(&resp->fh, &argp->fh);
7676
resp->status = fh_verify(rqstp, &resp->fh, 0,
@@ -220,7 +220,6 @@ nfsd3_proc_write(struct svc_rqst *rqstp)
220220
struct nfsd3_writeargs *argp = rqstp->rq_argp;
221221
struct nfsd3_writeres *resp = rqstp->rq_resp;
222222
unsigned long cnt = argp->len;
223-
unsigned int nvecs;
224223

225224
dprintk("nfsd: WRITE(3) %s %d bytes at %Lu%s\n",
226225
SVCFH_fmt(&argp->fh),
@@ -235,10 +234,8 @@ nfsd3_proc_write(struct svc_rqst *rqstp)
235234

236235
fh_copy(&resp->fh, &argp->fh);
237236
resp->committed = argp->stable;
238-
nvecs = svc_fill_write_vector(rqstp, &argp->payload);
239-
240237
resp->status = nfsd_write(rqstp, &resp->fh, argp->offset,
241-
rqstp->rq_vec, nvecs, &cnt,
238+
&argp->payload, &cnt,
242239
resp->committed, resp->verf);
243240
resp->count = cnt;
244241
resp->status = nfsd3_map_status(resp->status);
@@ -266,6 +263,8 @@ nfsd3_create_file(struct svc_rqst *rqstp, struct svc_fh *fhp,
266263
__be32 status;
267264
int host_err;
268265

266+
trace_nfsd_vfs_create(rqstp, fhp, S_IFREG, argp->name, argp->len);
267+
269268
if (isdotent(argp->name, argp->len))
270269
return nfserr_exist;
271270
if (!(iap->ia_valid & ATTR_MODE))
@@ -382,11 +381,6 @@ nfsd3_proc_create(struct svc_rqst *rqstp)
382381
struct nfsd3_diropres *resp = rqstp->rq_resp;
383382
svc_fh *dirfhp, *newfhp;
384383

385-
dprintk("nfsd: CREATE(3) %s %.*s\n",
386-
SVCFH_fmt(&argp->fh),
387-
argp->len,
388-
argp->name);
389-
390384
dirfhp = fh_copy(&resp->dirfh, &argp->fh);
391385
newfhp = fh_init(&resp->fh, NFS3_FHSIZE);
392386

@@ -407,11 +401,6 @@ nfsd3_proc_mkdir(struct svc_rqst *rqstp)
407401
.na_iattr = &argp->attrs,
408402
};
409403

410-
dprintk("nfsd: MKDIR(3) %s %.*s\n",
411-
SVCFH_fmt(&argp->fh),
412-
argp->len,
413-
argp->name);
414-
415404
argp->attrs.ia_valid &= ~ATTR_SIZE;
416405
fh_copy(&resp->dirfh, &argp->fh);
417406
fh_init(&resp->fh, NFS3_FHSIZE);
@@ -447,11 +436,6 @@ nfsd3_proc_symlink(struct svc_rqst *rqstp)
447436
goto out;
448437
}
449438

450-
dprintk("nfsd: SYMLINK(3) %s %.*s -> %.*s\n",
451-
SVCFH_fmt(&argp->ffh),
452-
argp->flen, argp->fname,
453-
argp->tlen, argp->tname);
454-
455439
fh_copy(&resp->dirfh, &argp->ffh);
456440
fh_init(&resp->fh, NFS3_FHSIZE);
457441
resp->status = nfsd_symlink(rqstp, &resp->dirfh, argp->fname,
@@ -476,11 +460,6 @@ nfsd3_proc_mknod(struct svc_rqst *rqstp)
476460
int type;
477461
dev_t rdev = 0;
478462

479-
dprintk("nfsd: MKNOD(3) %s %.*s\n",
480-
SVCFH_fmt(&argp->fh),
481-
argp->len,
482-
argp->name);
483-
484463
fh_copy(&resp->dirfh, &argp->fh);
485464
fh_init(&resp->fh, NFS3_FHSIZE);
486465

@@ -513,11 +492,6 @@ nfsd3_proc_remove(struct svc_rqst *rqstp)
513492
struct nfsd3_diropargs *argp = rqstp->rq_argp;
514493
struct nfsd3_attrstat *resp = rqstp->rq_resp;
515494

516-
dprintk("nfsd: REMOVE(3) %s %.*s\n",
517-
SVCFH_fmt(&argp->fh),
518-
argp->len,
519-
argp->name);
520-
521495
/* Unlink. -S_IFDIR means file must not be a directory */
522496
fh_copy(&resp->fh, &argp->fh);
523497
resp->status = nfsd_unlink(rqstp, &resp->fh, -S_IFDIR,
@@ -535,11 +509,6 @@ nfsd3_proc_rmdir(struct svc_rqst *rqstp)
535509
struct nfsd3_diropargs *argp = rqstp->rq_argp;
536510
struct nfsd3_attrstat *resp = rqstp->rq_resp;
537511

538-
dprintk("nfsd: RMDIR(3) %s %.*s\n",
539-
SVCFH_fmt(&argp->fh),
540-
argp->len,
541-
argp->name);
542-
543512
fh_copy(&resp->fh, &argp->fh);
544513
resp->status = nfsd_unlink(rqstp, &resp->fh, S_IFDIR,
545514
argp->name, argp->len);
@@ -553,15 +522,6 @@ nfsd3_proc_rename(struct svc_rqst *rqstp)
553522
struct nfsd3_renameargs *argp = rqstp->rq_argp;
554523
struct nfsd3_renameres *resp = rqstp->rq_resp;
555524

556-
dprintk("nfsd: RENAME(3) %s %.*s ->\n",
557-
SVCFH_fmt(&argp->ffh),
558-
argp->flen,
559-
argp->fname);
560-
dprintk("nfsd: -> %s %.*s\n",
561-
SVCFH_fmt(&argp->tfh),
562-
argp->tlen,
563-
argp->tname);
564-
565525
fh_copy(&resp->ffh, &argp->ffh);
566526
fh_copy(&resp->tfh, &argp->tfh);
567527
resp->status = nfsd_rename(rqstp, &resp->ffh, argp->fname, argp->flen,
@@ -576,13 +536,6 @@ nfsd3_proc_link(struct svc_rqst *rqstp)
576536
struct nfsd3_linkargs *argp = rqstp->rq_argp;
577537
struct nfsd3_linkres *resp = rqstp->rq_resp;
578538

579-
dprintk("nfsd: LINK(3) %s ->\n",
580-
SVCFH_fmt(&argp->ffh));
581-
dprintk("nfsd: -> %s %.*s\n",
582-
SVCFH_fmt(&argp->tfh),
583-
argp->tlen,
584-
argp->tname);
585-
586539
fh_copy(&resp->fh, &argp->ffh);
587540
fh_copy(&resp->tfh, &argp->tfh);
588541
resp->status = nfsd_link(rqstp, &resp->tfh, argp->tname, argp->tlen,
@@ -621,9 +574,7 @@ nfsd3_proc_readdir(struct svc_rqst *rqstp)
621574
struct nfsd3_readdirres *resp = rqstp->rq_resp;
622575
loff_t offset;
623576

624-
dprintk("nfsd: READDIR(3) %s %d bytes at %d\n",
625-
SVCFH_fmt(&argp->fh),
626-
argp->count, (u32) argp->cookie);
577+
trace_nfsd_vfs_readdir(rqstp, &argp->fh, argp->count, argp->cookie);
627578

628579
nfsd3_init_dirlist_pages(rqstp, resp, argp->count);
629580

@@ -655,9 +606,7 @@ nfsd3_proc_readdirplus(struct svc_rqst *rqstp)
655606
struct nfsd3_readdirres *resp = rqstp->rq_resp;
656607
loff_t offset;
657608

658-
dprintk("nfsd: READDIR+(3) %s %d bytes at %d\n",
659-
SVCFH_fmt(&argp->fh),
660-
argp->count, (u32) argp->cookie);
609+
trace_nfsd_vfs_readdir(rqstp, &argp->fh, argp->count, argp->cookie);
661610

662611
nfsd3_init_dirlist_pages(rqstp, resp, argp->count);
663612

@@ -698,9 +647,6 @@ nfsd3_proc_fsstat(struct svc_rqst *rqstp)
698647
struct nfsd_fhandle *argp = rqstp->rq_argp;
699648
struct nfsd3_fsstatres *resp = rqstp->rq_resp;
700649

701-
dprintk("nfsd: FSSTAT(3) %s\n",
702-
SVCFH_fmt(&argp->fh));
703-
704650
resp->status = nfsd_statfs(rqstp, &argp->fh, &resp->stats, 0);
705651
fh_put(&argp->fh);
706652
resp->status = nfsd3_map_status(resp->status);

0 commit comments

Comments
 (0)