From nobody Mon May 16 19:26:58 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 5D8201B33017; Mon, 16 May 2022 19:26:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4L28QB25pGz4sS9; Mon, 16 May 2022 19:26:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652729218; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=y/jb5Ms6npABqwmiQexUnYhOpfwCp1nDY+RCRQNgiow=; b=qHG95tZc9G5JyD7IUc5t2mfNzjNj2+whPb5wKltKgXWxySx3R9d1TduD4hvd+Amy8tlujU ufgO0E+Qc5Mcn43Nj0ti5lVVBlJyiuoVLQ+D8DXDMSIOcP67TFwB2elBp2/RPhgO2YzH0E OUas1zzN7CIab/mVEGW9UzbZzZ8RiTR/wSM4Q/UPTdcGU89fYwOT4b7C0/uvj8Jc3pTzwc GUNFmNhqzBieHJk4xRZGSUQrvvprTAqfcOWguOEda0ibyWfd81Bt0sTOb9i8X3penUPjmf 1RonzlrdHOauIVpPT6NC74K7OIbuMu4QRdEx27vF3CSpiY7bJ8ZLRyOgoZHEGA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 27F39260DC; Mon, 16 May 2022 19:26:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 24GJQwGS032057; Mon, 16 May 2022 19:26:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 24GJQwKh032056; Mon, 16 May 2022 19:26:58 GMT (envelope-from git) Date: Mon, 16 May 2022 19:26:58 GMT Message-Id: <202205161926.24GJQwKh032056@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 81091a7ca11a - stable/12 - nfsd: Fix session slot freeing for NFSv4.1/4.2 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 81091a7ca11acd5adcc673ffd06f8e08791386ea Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652729218; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=y/jb5Ms6npABqwmiQexUnYhOpfwCp1nDY+RCRQNgiow=; b=jS3Va6ue+yNC96BRyamEe5orUA6feWIFxdKpCWPeA0+bN84ea9reLWgrcWdQ9o1/PUTk9A B7seuyJBnNFomW4L64REEa1xsnx44ws/zZkEZ35em/khGwCAEihQIsHOrdavhqoSC3exUh RXxuft5yupa1wT17BMPkR56KctowVidufiMxHf8FAD6af8eSwyT2bDeS0Zu9uuhnW8krX3 iX91zhHDlocQS9f+hyByeT08fnM4zc4mHVGPOhngRFH+sazjs7RRY1fQovl841ZHr59yHE 5xbxtYsDuZVq4zkdwEGiyx0KM+g5dTulbLdaEG7sqVv6m0YV65MigtgPlidEoQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1652729218; a=rsa-sha256; cv=none; b=lT9KmVVP7GYODkbWv73g5wZhWx60xiq5Gi9PD3+UlRdcVYx1jaRyGfApaTXum95xiIJuke Nc2bbLkx1rPXQ8MK7gxRQfTwHiDDjvt3vR8aLnXk2VRMUwYNgtWYvksEfLHgA1//Mog+Bv fkBs7USA3RwZ/SB1XTB8/Dsi6fZpjpGhR8siXm3moCw3UFjGiEMvcAbJH0qRRR+koAliQA W19Tkt8DRnUaA7o51QlTZiihHZk2BbyqJLbTYKyUUhRAxskEey6n3NRuGUF6LsOaBtpIu6 q90L8LD6MRMiCC33EptImCbKJbYSkmnqPDwEZhtJoAExI6aI+DA7bXD86vfVEA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=81091a7ca11acd5adcc673ffd06f8e08791386ea commit 81091a7ca11acd5adcc673ffd06f8e08791386ea Author: Rick Macklem AuthorDate: 2022-05-02 19:45:42 +0000 Commit: Rick Macklem CommitDate: 2022-05-16 19:26:18 +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 d9fa64e5c416..1ca275c670fc 100644 --- a/sys/fs/nfsserver/nfs_nfsdstate.c +++ b/sys/fs/nfsserver/nfs_nfsdstate.c @@ -6621,6 +6621,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);