Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 May 2022 19:21:55 GMT
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: a3821a906e42 - stable/13 - nfsd: Fix session slot freeing for NFSv4.1/4.2
Message-ID:  <202205161921.24GJLtQn030698@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by rmacklem:

URL: https://cgit.FreeBSD.org/src/commit/?id=a3821a906e42ad7b1886d1febbe63baa704d2029

commit a3821a906e42ad7b1886d1febbe63baa704d2029
Author:     Rick Macklem <rmacklem@FreeBSD.org>
AuthorDate: 2022-05-02 19:45:42 +0000
Commit:     Rick Macklem <rmacklem@FreeBSD.org>
CommitDate: 2022-05-16 19:21:06 +0000

    nfsd: Fix session slot freeing for NFSv4.1/4.2
    
    Without this patch the NFSv4.1/4.2 server erroneously
    always frees session slot zero for callbacks.  This only
    affects 4.1/4.2 mounts if the server has delegations
    enabled or is a pNFS configuration.  Even for those
    cases, the effect is mainly to only use slot 0 for
    callbacks, serializing all of them.  There is a slight
    chance that callbacks will fail if the client performs
    them in a different order than received on the TCP
    connection.
    
    If this bug affects your server, you will see console
    messages like:
      newnfs_request: Bad session slot
    
    This patch fixes the problem.  Found during a recent
    IETF NFSv4 testing event.
    
    PR:     263728
    
    (cherry picked from commit 271f6d52a606e86c11b366082f11fe69350f24da)
---
 sys/fs/nfsserver/nfs_nfsdstate.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sys/fs/nfsserver/nfs_nfsdstate.c b/sys/fs/nfsserver/nfs_nfsdstate.c
index 2abb99a5079e..9059b032cb86 100644
--- a/sys/fs/nfsserver/nfs_nfsdstate.c
+++ b/sys/fs/nfsserver/nfs_nfsdstate.c
@@ -6646,6 +6646,8 @@ nfsv4_setcbsequence(struct nfsrv_descript *nd, struct nfsclient *clp,
 	bcopy(sessionid, tl, NFSX_V4SESSIONID);
 	tl += NFSX_V4SESSIONID / NFSX_UNSIGNED;
 	nd->nd_slotseq = tl;
+	nd->nd_slotid = *slotposp;
+	nd->nd_flag |= ND_HASSLOTID;
 	*tl++ = txdr_unsigned(slotseq);
 	*tl++ = txdr_unsigned(*slotposp);
 	*tl++ = txdr_unsigned(maxslot);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202205161921.24GJLtQn030698>