From nobody Sun Apr 28 00:36:39 2024 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 4VRnZv5gkYz5KBKd; Sun, 28 Apr 2024 00:36:39 +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 4VRnZv3gYFz4RKd; Sun, 28 Apr 2024 00:36:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714264599; 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=Mrf0AlnaZyB2OizQHN9mT60OwmjUzxe3aW0iuWEJU3g=; b=iI6X4nGx138hy1dVYZKz0kezmqtrunvi5OrJ1fW6oASyPdHRBCK2aMOY1sqxslfdCyYbKf 7PgckxDSrxEUEdn4HrK1uAv2I/15YR4azSpVLRkpHL3mlUr8aWA9xCx5FMzi0D7leD/EoW Vi99ikVQCi6p9S/rJPjc/4zf6GoNlVNlMdi88pK26q1bJ+Xarw2N2Eig0O2N8u65wb9WYD XQ0RozoadIoLXpSIaGspzTSia3ZFPSak1OyvMGQ9SWM7VXFasYzdqWPwAe9m53SMrIyZRh CLINiR5ex7EQArwc0uTbJpeQIZWfprxOPBzrjj1uODVp6wutfAdX9lX4R2TVew== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714264599; a=rsa-sha256; cv=none; b=rsmgzNgwDHLjO8VIbPr2pRSpHvFxngr2cQ5ynbI0XeGbpzaMalX8W13PaU7aDkHDrjxUkl kCTtcaP/kbYl/RVJWkn/WlYgM6WmxsOlbOQRUkWOUWARxrn8uf6L2V6FpBtDaE9IwFaZs7 ImELTcJIBgFA4TreX7tAQFG4NgPdE+ifZN1QO2mxzUy3fJsQhOoUV36wKj+BQiEfLSYcgi RzMuxDrXM+mPDGF7wUIbaI7f4gFzphaLpUCO+5YolbRxkXBelN9tdjeucPGkSwOB+4yCr5 BfKF25y663kXGJYzOHnN8Ag/ZemGkuQb+px84qUpZBuph8aP4Rov5J8wVxaqhw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714264599; 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=Mrf0AlnaZyB2OizQHN9mT60OwmjUzxe3aW0iuWEJU3g=; b=bLxJrJKth2V8yWEPEVPBtqB1rLEnHC7fBSSgxjYU0CRp6MW/FKEFpf1rO0DrQPKWCcUmEM wfCs6UO7sET9wPxrz4zvxda+cb+WtNBYtRQXYt9zcEalljM8cQfbmvzEsP4V9NHxO764TO bO/RmGnXt8q0cCfoLAGuBBq+62a8/FcJifuiA6AInVSl0wGEIFk6nQrJQAlqJQeGp/T9cn Sl4R2KvlucnjgBoLuAfqJffve+SsMR0SOidN0IvW3tbyW6j5dws4SdcBvi7+bqEWGLO2Fr 6cCnaSaoLPyKyf3iVXGIlTsW2785yMQIbUw7dWNdh/pdlVUAeqQ9WCqS4zJ09A== 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 4VRnZv3GB1z13Ff; Sun, 28 Apr 2024 00:36:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43S0adke012966; Sun, 28 Apr 2024 00:36:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43S0adE5012963; Sun, 28 Apr 2024 00:36:39 GMT (envelope-from git) Date: Sun, 28 Apr 2024 00:36:39 GMT Message-Id: <202404280036.43S0adE5012963@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: 2fe5dc8691d5 - stable/14 - nfscl: Revert part of commit 196787f79e67 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/14 X-Git-Reftype: branch X-Git-Commit: 2fe5dc8691d5b90b06818b417da9b01683b49e68 Auto-Submitted: auto-generated The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=2fe5dc8691d5b90b06818b417da9b01683b49e68 commit 2fe5dc8691d5b90b06818b417da9b01683b49e68 Author: Rick Macklem AuthorDate: 2024-04-25 19:32:02 +0000 Commit: Rick Macklem CommitDate: 2024-04-28 00:35:22 +0000 nfscl: Revert part of commit 196787f79e67 Commit 196787f79e67 erroneously assumed that the client code for Open/Claim_deleg_cur_FH was broken, but it was not. It was actually wireshark that was broken and indicated that the correct XDR was bogus. This reverts the part of 196787f79e67 that changed the arguments for Open/Claim_deleg_cur_FH. Found during the IETF bakeathon testing event this week. (cherry picked from commit 8efba70d7914324890b1f8fe3079036eb2b5c3db) --- sys/fs/nfsclient/nfs_clrpcops.c | 33 ++++++++++----------------------- sys/fs/nfsclient/nfs_clstate.c | 23 +---------------------- sys/fs/nfsclient/nfsmount.h | 1 - 3 files changed, 11 insertions(+), 46 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index 09660730d485..75bb5236cb65 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -561,34 +561,21 @@ nfsrpc_openrpc(struct nfsmount *nmp, vnode_t vp, u_int8_t *nfhp, int fhlen, *tl = txdr_unsigned(delegtype); } else { if (dp != NULL) { - if (NFSHASNFSV4N(nmp)) { + if (NFSHASNFSV4N(nmp)) *tl = txdr_unsigned( NFSV4OPEN_CLAIMDELEGATECURFH); - NFSLOCKMNT(nmp); - if ((nmp->nm_privflag & NFSMNTP_BUGGYFBSDSRV) != - 0) { - NFSUNLOCKMNT(nmp); - /* - * Add a stateID argument to make old - * broken FreeBSD NFSv4.1/4.2 servers - * happy. - */ - NFSM_BUILD(tl, uint32_t *,NFSX_STATEID); - *tl++ = 0; - *tl++ = dp->nfsdl_stateid.other[0]; - *tl++ = dp->nfsdl_stateid.other[1]; - *tl = dp->nfsdl_stateid.other[2]; - } else - NFSUNLOCKMNT(nmp); - } else { + else *tl = txdr_unsigned(NFSV4OPEN_CLAIMDELEGATECUR); - NFSM_BUILD(tl, u_int32_t *, NFSX_STATEID); + NFSM_BUILD(tl, u_int32_t *, NFSX_STATEID); + if (NFSHASNFSV4N(nmp)) + *tl++ = 0; + else *tl++ = dp->nfsdl_stateid.seqid; - *tl++ = dp->nfsdl_stateid.other[0]; - *tl++ = dp->nfsdl_stateid.other[1]; - *tl = dp->nfsdl_stateid.other[2]; + *tl++ = dp->nfsdl_stateid.other[0]; + *tl++ = dp->nfsdl_stateid.other[1]; + *tl = dp->nfsdl_stateid.other[2]; + if (!NFSHASNFSV4N(nmp)) (void)nfsm_strtom(nd, name, namelen); - } } else if (NFSHASNFSV4N(nmp)) { *tl = txdr_unsigned(NFSV4OPEN_CLAIMFH); } else { diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index ebc11efea637..9fbaa6e63a56 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -4512,7 +4512,6 @@ nfscl_tryopen(struct nfsmount *nmp, vnode_t vp, u_int8_t *fhp, int fhlen, { int error; struct nfscldeleg *dp; - bool try_busted_xdr; dp = *ndpp; do { @@ -4520,29 +4519,9 @@ nfscl_tryopen(struct nfsmount *nmp, vnode_t vp, u_int8_t *fhp, int fhlen, error = nfsrpc_openrpc(nmp, vp, fhp, fhlen, newfhp, newfhlen, mode, op, name, namelen, ndpp, reclaim, delegtype, cred, p, 0, 0); - try_busted_xdr = false; if (error == NFSERR_DELAY) (void) nfs_catnap(PZERO, error, "nfstryop"); - else if (error == NFSERR_EXPIRED && NFSHASNFSV4N(nmp) && - reclaim == 0 && dp != NULL) { - /* This case is a Claim_Deleg_Cur_FH Open. */ - NFSLOCKMNT(nmp); - if ((nmp->nm_privflag & NFSMNTP_BUGGYFBSDSRV) == 0) { - /* - * Old FreeBSD NFSv4.1/4.2 servers erroneously - * expect a stateID argument for Open - * Claim_Deleg_Cur_FH and interpret the - * Getattr reply as a stateID. This results - * in an NFSERR_EXPIRED failure. - * Setting NFSMNTP_BUGGYFBSDSRV makes the Open - * send a stateID, in violation of RFC8881. - */ - try_busted_xdr = true; - nmp->nm_privflag |= NFSMNTP_BUGGYFBSDSRV; - } - NFSUNLOCKMNT(nmp); - } - } while (error == NFSERR_DELAY || try_busted_xdr); + } while (error == NFSERR_DELAY); if (error == EAUTH || error == EACCES) { /* Try again using system credentials */ newnfs_setroot(cred); diff --git a/sys/fs/nfsclient/nfsmount.h b/sys/fs/nfsclient/nfsmount.h index 7571add27b9c..37b84a015dab 100644 --- a/sys/fs/nfsclient/nfsmount.h +++ b/sys/fs/nfsclient/nfsmount.h @@ -124,7 +124,6 @@ struct nfsmount { #define NFSMNTP_DELEGISSUED 0x00000400 #define NFSMNTP_NODEALLOCATE 0x00000800 #define NFSMNTP_FAKEROOTFH 0x00001000 -#define NFSMNTP_BUGGYFBSDSRV 0x00002000 /* New mount flags only used by the kernel via nmount(2). */ #define NFSMNT_TLS 0x00000001