From nobody Fri Sep 02 02:16:45 2022 X-Original-To: dev-commits-src-branches@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 4MJhPB1M9tz4bSS8; Fri, 2 Sep 2022 02:16:46 +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 4MJhPB0mYGz3Gsn; Fri, 2 Sep 2022 02:16:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662085006; 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=CVrLpxdmxIXEbBV4rL/AsIgyacsYlIawUWJwZSis85w=; b=EZDnQaWH6b9CF4B2LX+jKDlBY02ZCy16UdM1H3maCiuCeXe82oF94ZZJEYb4ndFSxDDR8J VdrbH18U5X1mrRo/er/E6R1SmO5FF/AK5Jdpn4QfhA6TIEVZwOdZv9HS26M2a7dWdTOq0g m0+qxL4viwUNxOS5TOryx5my72R/1K0Mqbjg7+2f6Cgt20OVwxe7oiC/uYT3UQjieYH6FW 3gRb9J9EgqD9o9V2PmWsL87OSXU9tdfwN46qLwwP7jiSH2klrcaAbxkYVLMy7neNYlxT/J 5Cqn4/ja/acyd9IS8dTBVN2kXBeQs2awqqf7xslmh74D+rcMF2GZq8HnYTXzDw== 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 4MJhP96wfkzgQn; Fri, 2 Sep 2022 02:16:45 +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 2822Gjn6075479; Fri, 2 Sep 2022 02:16:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2822GjtB075478; Fri, 2 Sep 2022 02:16:45 GMT (envelope-from git) Date: Fri, 2 Sep 2022 02:16:45 GMT Message-Id: <202209020216.2822GjtB075478@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: 1dab52045cb2 - stable/12 - nfscl: Fix handling of nd_slotid while handling NFSERR_BADSESSION List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: 1dab52045cb26b945bd1737e2b40a52c6d4325cf Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662085006; 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=CVrLpxdmxIXEbBV4rL/AsIgyacsYlIawUWJwZSis85w=; b=VPeCNSikXNIOKeVGlVOK7ziIRvewen6xT5CJGF5HGhB336heNq4GReLVTURUIiRXHAsL7G wpQQH14qnVgoR50XAZRi+PolWsB0UoAS8MNIWFdFVolIecEd1MP1iriS/cDxi1cht8FBk2 rS4YlOcqS1gQd2sAJ42/lbl369giy81cPYzyyfRUQNtbjLPy26spp2w0dwDH+ZXqHKg7dU a/HrymPiryUiK/uNZhi/7DVJXb7JF+hwNi8b6Gby/E+LCtbgFiO9j7mErgWbRVIAwY3iRT d4OtkV1aQbH1E+t/CU+ZxOQOF7iXn+XznLyinfm8+wnb0XdXD/r29RiTzm++Ew== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1662085006; a=rsa-sha256; cv=none; b=EhrSRQVWFBGQIbaHxyCLgVDqz2NlAhGKR3qdGJhC/jT27a4hn2d9Mn8g8TqNJOlXEMpQ4G sNHm1Zfq5PvbXtMZIb7tP3KEcqm7htE+rl0cVanU3Qe3OXSCQgiCOGmq4PZiXr3I3k0s76 5agXah3t7GjMv76sxprTDp3BY5kif8RF9NDjVXPfdD0AOdM99SSf59tlEcBoxPSNmsZpk4 s3JsUhjNQm5bCX6Dk5tmpBtj/yRg/iLKorZ20SbS18HAy66hz7AS30X+Yvqt21gXdAHpn6 GxlekiV9tLYf7iAO+HFNBT3L/TI7y1z2PibPNsB0bjiLwYsk79LjJbIaH/pQyQ== 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=1dab52045cb26b945bd1737e2b40a52c6d4325cf commit 1dab52045cb26b945bd1737e2b40a52c6d4325cf Author: Rick Macklem AuthorDate: 2022-08-27 23:03:18 +0000 Commit: Rick Macklem CommitDate: 2022-09-02 02:13:52 +0000 nfscl: Fix handling of nd_slotid while handling NFSERR_BADSESSION When the NFSv4.1/4.2 client is handling a server error of NFSERR_BADSESSION, it retries RPCs with a new session. Without this patch, the nd_slotid was not being updated for the new session. This would result in a bogus console message like "Wrong session srvslot=X slot=Y" and then it would free the incorrect slot, often generating a "freeing free slot!!" console message as well. This patch fixes the problem. Note that FreeBSD NFSv4.1/4.2 servers only generate a NFSERR_BADSESSION error after a reboot or after a client does a DestroySession operation. PR: 260011 (cherry picked from commit fb29f817586972444d65b1548287a51f27891639) --- sys/fs/nfs/nfs_commonkrpc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/fs/nfs/nfs_commonkrpc.c b/sys/fs/nfs/nfs_commonkrpc.c index 934e964b35d6..115f0f7a01e6 100644 --- a/sys/fs/nfs/nfs_commonkrpc.c +++ b/sys/fs/nfs/nfs_commonkrpc.c @@ -1055,6 +1055,8 @@ tryagain: *tl++ = txdr_unsigned(slotseq); *tl++ = txdr_unsigned(slotpos); *tl = txdr_unsigned(maxslot); + nd->nd_slotid = slotpos; + nd->nd_flag |= ND_HASSLOTID; } if (reterr == NFSERR_BADSESSION || reterr == 0) {