From nobody Sat Aug 27 23:04:25 2022 X-Original-To: dev-commits-src-main@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 4MFXMY3NKkz4bNZM; Sat, 27 Aug 2022 23:04:25 +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 4MFXMY2ny4z3Gms; Sat, 27 Aug 2022 23:04:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1661641465; 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=B2MngO98QeyZ7rYnCu6bilutjMBy7LBQ0zN96289sd8=; b=FIfGaYj3rE6vKtmdTpYybOyUXTYVP4YmkhgTPuDCGGWNv9uex+2ZjNWsOqDxouhnu13OaW CmYVjxd8mVgOLiZTF5Sm3fkgyYMO1Mz7MXS7CXZ9m1KzbDWKkmJ2uZF/wCSg5lRDqVywVW p8hB673U/D168Zt3fEVOmlBAMUWzUhLc2VJNW3HYo8cLg09c9rLm6X9lQhXIPSzpPkQs7k +Edoo1kdW/3UeTaPLDmiB0/D1YueBoTdlXSFXGPZ04aEzLpRynfLihU+38Y4C0+2A8ykkX rMTqKAkgDUYvoy/Dm4y7JAeGWOi69h6sxQASovmM4Fn2K1c+CV7OIPdZd3xF+A== 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 4MFXMY1pm3ztnY; Sat, 27 Aug 2022 23:04:25 +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 27RN4Pb6087254; Sat, 27 Aug 2022 23:04:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 27RN4PVs087253; Sat, 27 Aug 2022 23:04:25 GMT (envelope-from git) Date: Sat, 27 Aug 2022 23:04:25 GMT Message-Id: <202208272304.27RN4PVs087253@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: fb29f8175869 - main - nfscl: Fix handling of nd_slotid while handling NFSERR_BADSESSION List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: fb29f817586972444d65b1548287a51f27891639 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1661641465; 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=B2MngO98QeyZ7rYnCu6bilutjMBy7LBQ0zN96289sd8=; b=XM3FCjPkfxyXcogLTyxhQw9cqJXXr0j5a0NLSPSQplj5l7keEuzqJ3ghAzkPkxOFGzwfbT yziM4RpvH+UI3srvX1QmmHr2hbqxVAyTlfcQJZrkNcnAlENJuAlPF8XrS6tL2qQXwI8y3E jlvLhz6lmLhwnpO+CkLiSS+1gsa5sNrtN4TLAYCH+LlBbBV8FcTmwUMWXmiMzl7oAMCV35 K3O6KBrqj9U85zrcgEQ5Rruosol3lHCGqETTrO9Xxbi0avL8wEOyh47fQ89PnXNV1cHvoF 8xyppWwTCiBKbfXJNqOmeyKJiDqlxORnJRbcS/PGhYVCLoWJu0jL2AjZ6X/JVw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1661641465; a=rsa-sha256; cv=none; b=C/jEOv+T8ALo/KLi1IXyc6lbUHHqm3XlClKZTrgSr3hEZ0PYitDOXBe/N5OvZPMo7ZMmxx M4DIknRcDpNDwV6LOq/KHZB1vnMWF1ZBEFqt2ksqvHPyOqMEHIQIfvh1Ig/FQRdX0L4kzE ARZ0u4fat5Vz2aYQX9V5OrEN7xV0uWrkHMo8/s5VexA18/67uHeav3XkJ1NziaGdTl83jT +Urg9SMG6s/cSbzLf/0V+BTbodIm/ug/gkXqvMzqgorQC1W/lRnYa+2sRauRVZQBIYAHH/ TDdN/fizpVY4RJnVltHyJ/XATmbv6kuVCcj0B9OnqpTKT88rXUByAfx/SD9xRQ== 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=fb29f817586972444d65b1548287a51f27891639 commit fb29f817586972444d65b1548287a51f27891639 Author: Rick Macklem AuthorDate: 2022-08-27 23:03:18 +0000 Commit: Rick Macklem CommitDate: 2022-08-27 23:03:18 +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 MFC after: 1 week --- 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 916d0182d3ee..91ebd84fabd0 100644 --- a/sys/fs/nfs/nfs_commonkrpc.c +++ b/sys/fs/nfs/nfs_commonkrpc.c @@ -1169,6 +1169,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) {