Date: Tue, 19 May 2026 00:59:37 +0000 From: Rick Macklem <rmacklem@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 29a286d14ac5 - stable/14 - nfs_nfsdserv.c: Clip number of callback slots Message-ID: <6a0bb5f9.27d31.683d7889@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=29a286d14ac50b73e3f241a8b8d4f4a4afdd22cc commit 29a286d14ac50b73e3f241a8b8d4f4a4afdd22cc Author: Rick Macklem <rmacklem@FreeBSD.org> AuthorDate: 2026-05-05 00:04:00 +0000 Commit: Rick Macklem <rmacklem@FreeBSD.org> CommitDate: 2026-05-18 23:57:26 +0000 nfs_nfsdserv.c: Clip number of callback slots The client tells the server how many callback slots it can handle in the callback session. However, the NFSv4.1/4.2 server can only handle a maximum of NFSV4_SLOTS slots. This patch clips the client's value to that, to avoid using too high a slot# for a callback. Fortunately, I do not know of an extant client that specifies a value greater than NFSV4_SLOTS, so this patch is not really needed, as yet. Also, the client rarely uses a slot# above 0 when doing callbacks. (cherry picked from commit 03e9e83f358678bab5e4c1ddf9c9d8faa7183cbb) --- sys/fs/nfsserver/nfs_nfsdserv.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/fs/nfsserver/nfs_nfsdserv.c b/sys/fs/nfsserver/nfs_nfsdserv.c index 460d08bd1da0..8d4501a286cc 100644 --- a/sys/fs/nfsserver/nfs_nfsdserv.c +++ b/sys/fs/nfsserver/nfs_nfsdserv.c @@ -4616,6 +4616,14 @@ nfsrvd_createsession(struct nfsrv_descript *nd, __unused int isdgram, *tl++ = txdr_unsigned(sep->sess_cbsess.nfsess_foreslots); *tl++ = txdr_unsigned(1); *tl = txdr_unsigned(0); /* No RDMA. */ + /* + * Although the client accepts slot#s up to + * sess_cbsess.nfsess_foreslots, the server can only use + * a maximum of NFSV4_SLOTS, so clip it to avoid ever using + * too high a slot. + */ + if (sep->sess_cbsess.nfsess_foreslots > NFSV4_SLOTS) + sep->sess_cbsess.nfsess_foreslots = NFSV4_SLOTS; } nfsmout: if (nd->nd_repstat != 0 && sep != NULL)home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a0bb5f9.27d31.683d7889>
