From nobody Mon May 02 19:48:21 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 AD5701AAD628; Mon, 2 May 2022 19:48:21 +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 4KsYYK484Jz4c0F; Mon, 2 May 2022 19:48:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651520901; 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=9wxcdqum605bz2Zh3yXjyMNuRYAHAHjPSJQxclovg3c=; b=JMzEXVyNH8LqdxfALiPgZc5OQN5Ug9yRH9uQ2FssYtpmXnMbnArkDsV5It+TOml+MB0vB+ 2zlHw+tagR5CBSQfREVQLnPMSnkvJ8vHeeCXQYcEYxak8hk02fYCyUssypgaVTtWV5uQ31 apHT9dRxlMD++QHYTpwWQ0BLhccEQEXfRmcU+Nf0zJhIj2KDdPAjndNKWhnE3i2CXBFpQi Hqdn0k4sx5sY4yo+4zBJcO3aZm3HiKAzPT7ywJjZRqN/6dqrY3o4J/CSmiN8AGvTQZV6+R XsauSZitY3z8s5251W0RzQXOdyh2gYuU8zp2p6alKw+rFGPmsrqPODbZy/E7Mw== 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 6DB89104E6; Mon, 2 May 2022 19:48:21 +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 242JmL7K094889; Mon, 2 May 2022 19:48:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 242JmLFq094888; Mon, 2 May 2022 19:48:21 GMT (envelope-from git) Date: Mon, 2 May 2022 19:48:21 GMT Message-Id: <202205021948.242JmLFq094888@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 271f6d52a606 - main - 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/main X-Git-Reftype: branch X-Git-Commit: 271f6d52a606e86c11b366082f11fe69350f24da Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651520901; 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=9wxcdqum605bz2Zh3yXjyMNuRYAHAHjPSJQxclovg3c=; b=jxBBG0bK7mNCec0RLylDyKoaHQ1V1rUDkgCJgi1pXtOofOrdpD3UiZJxJJPVjB1Vcxlwmp YQGfeIMObr3kZRuf5Y1raypP/54fzFHBd8mwl2AzuVVmF9T80sQQo0VcsV7Bmo3lzw8iR8 PRqG+faQ85XpGDz18EYFCB3Y1HX4ms+qdvyv+D2nBHV3X/PFT6hPP/rmV6U0EuZ9laaO0R Op0+2/ml5K1zZpo0ikbqhUBaKgLMM0uqbg8OdtRTCgFkvIA22PhZD5ZHznmZf0es84kPQW ogSBogGR/WaPdhoo2Zq1UeV5HDfWMFmK4GWuoCGnIih6Ggqg54nDnNPoJk1UNw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1651520901; a=rsa-sha256; cv=none; b=ENuo9UJ7B7w4c2DRb97Nf2+3+8jtwFSoO/u7/QVHcLvdszbvXzX2BbuT4QqxOcWCFmeSTp 6ArN9pu5YHydgnzI2XCyeqDwpKPJqpUMYsSnzba25lPJ7Fwz2VdpEnlKVgQnhTR7Nurp6/ Y8cxJnTm89sP0QrgW0IAZCVI7k60cMHsg44c1zwyaBZK7JpWwXZA7c16HlB33MF4+MEAaB gPbxMwXUpyId2M5iEzrS7jRQ628Q2D6UB62/slV38eZ0YjOCYglTNoc9MwiKMrR0XBmLzq e3hPMu5D3g3yyrWwh51ecolBL6jP6STMcJ6wp4SqhLlyt+l91j74dSDxRGLgLA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=271f6d52a606e86c11b366082f11fe69350f24da commit 271f6d52a606e86c11b366082f11fe69350f24da Author: Rick Macklem AuthorDate: 2022-05-02 19:45:42 +0000 Commit: Rick Macklem CommitDate: 2022-05-02 19:47:43 +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 MFC after: 2 weeks --- 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 7207be315db8..353ca80bc97e 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);