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.

MFC after:	2 weeks
This commit is contained in:
Rick Macklem
2026-05-04 17:04:00 -07:00
parent 658bb99db9
commit 03e9e83f35
+8
View File
@@ -4869,6 +4869,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)