From nobody Fri Aug 26 03:49:04 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 4MDQmw6Sw1z4bH52; Fri, 26 Aug 2022 03:49:04 +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 4MDQmw61x7z3Nr4; Fri, 26 Aug 2022 03:49:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1661485744; 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=qWvBxdHf6/uYoqleMBYkuoIZslyjo3GMJx4E1mCFJJ4=; b=dKpRWtsuk2L6PpKAnD7sDIv3mdRLeyP7idrik66r18oryq9MU9SMv59kyB8hB7pPvVvSS5 gXKp+Z8tq8gQFJlms08jhTkeavS+fKoDlMjLoP/i7qyXrDZym6JjXU7nivnRKH04LFblf4 oah3OTwzUmbcJLs3XlP2WuvuKKcXum1DB9agwnIz00seyHuadzHAbIf7TIy4Ys5tsID1nQ WpftX59Z05xEOcPAo3iAbZl4oxOqqSK4WiEpAVfyFeljmuiVdSj1FfA+waI0LL2ModT1XC 9n++OzuhtkuaF9QnsoorwlL2I3Q1qfADP2LohN+JbD5bJk8zx31tByqBEPNw7Q== 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 4MDQmw4zkYz1CjV; Fri, 26 Aug 2022 03:49:04 +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 27Q3n4W2006763; Fri, 26 Aug 2022 03:49:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 27Q3n4BT006762; Fri, 26 Aug 2022 03:49:04 GMT (envelope-from git) Date: Fri, 26 Aug 2022 03:49:04 GMT Message-Id: <202208260349.27Q3n4BT006762@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: 8e59ec29e47f - 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: 8e59ec29e47f6ec64f54ddd88cab388ae536f0ff Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1661485744; 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=qWvBxdHf6/uYoqleMBYkuoIZslyjo3GMJx4E1mCFJJ4=; b=tyDSFaQTvKpwKauW9EgyU5kNVqzrsvznqhq3naSnN52POgygNJQAVRuaooj0bH7nasILLD HOZwmzBrFoxbnfkYUD4QgQ7dD4XvhY0MJBn3mGK+JbzeXENI7yZ3K2cRG+CS9QPR8bwxyw hY79ajMlTsg1qaG21Iw0kxhaJrvupDU6hHqs7fhU9D12hGxZM8j62qpj6gHhNfo9JOQTNY oZvJ0YaN/vEFEuG0Voiyu1jkCcyrBwulfvzgjhi2Tlhd5y+Foh106IS74BE//aJpWfjiXF 5eXXuOqt8P02mrYEOFVTwlhr8lljAhVNLWcT/TEwWHaKU15MQNlHXsef0nSMrA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1661485744; a=rsa-sha256; cv=none; b=pXOpRg3Og7MQrYJYwRvVBRiUD0EN6pr1YTxYLUUYVzk/SmIkGOwtNMtBTlVfw0mCdUd5U3 mqb4RaaXzFkMk4nEbRoiY917slHKm7l4OmzugeFrCh+MroJIMHLBwRPJnycJ98rXH0x7vm wK7o8fapw6dbJJ0C6dhxDxazr0SFTITo1dzzCPJpe6ggipeLZZMXnMZArwRN3BcOXRcGox 7jPq4ZtPyAkBsYWzju2r9VDBQvYEzmg6PbCO+fR60FqBOjT83dLvW/vJBvN/rjwvknYtqM XJ01m6HzUibcuB6cwzx2XFBlx6gTjHDrY/2bETWTZhfNyVwMUqI2m8tnvn6hSg== 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=8e59ec29e47f6ec64f54ddd88cab388ae536f0ff commit 8e59ec29e47f6ec64f54ddd88cab388ae536f0ff Author: Rick Macklem AuthorDate: 2022-08-26 03:48:04 +0000 Commit: Rick Macklem CommitDate: 2022-08-26 03:48:04 +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 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/fs/nfs/nfs_commonkrpc.c b/sys/fs/nfs/nfs_commonkrpc.c index 916d0182d3ee..d630c6c69ede 100644 --- a/sys/fs/nfs/nfs_commonkrpc.c +++ b/sys/fs/nfs/nfs_commonkrpc.c @@ -1169,6 +1169,9 @@ tryagain: *tl++ = txdr_unsigned(slotseq); *tl++ = txdr_unsigned(slotpos); *tl = txdr_unsigned(maxslot); + if ((nd->nd_flag & + ND_HASSLOTID) != 0) + nd->nd_slotid = slotpos; } if (reterr == NFSERR_BADSESSION || reterr == 0) {