From nobody Thu Apr 25 19:33:35 2024 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 4VQQy75ncqz5JP8q; Thu, 25 Apr 2024 19:33:35 +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 4VQQy74z8Dz4jlW; Thu, 25 Apr 2024 19:33:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714073615; 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=cbku9ZNc7U2P5sy6evPDxjMMX5vsgDfT8baYueUTGT4=; b=su4Gua+zGDzd/php7Hz4+ou+R/xIKdlPFFXFctmETmWPLaoB9buVy3jhdIgYLErDFlmW1L dgEPaoN5zoJXxB7WnlJcgZYcpX42iZJP3E6KFnKO5nQaTL5LwVSfSxAgHR5DOz5Yi5I73q ZeLyoV6TjWk3Z0anCUYDNKugddtEZi67FQV/QdtVIP+85zjaFhOZKGcZwqhyJP1qwqfLQP tdK9br6xyXTVtNV80Ysszp2jTx4MSSlhEayrKJ6kY4KDdkdsTfJDjEg2uGIVZtS3w6KZdV f9sVas9is0EyWiMMUS1TCQD9FmzcAfLRk8COEjwPtuUK85FUMS8SaGtqgoWzFQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714073615; a=rsa-sha256; cv=none; b=FcyMdfekOG72REJ5wbCs/HHX6/9YT/ucQ8011wXkil8MMvIB5lM1AsEuj3AHieedrzKmHG bvbyxwoucjAYJZEZK9vocB0+3pQEcWeQ/dNYOsShjpMG9Qxms6r/BfKnr+1dLd/3/rdZ0K uwYQIX/nf0q7zk9hBdT0Z/fCW5d+9F4h66X+no+MZ27GWsqLDcXzg9rDfRI7jjoyFpbhKS UbvniMjx2JW9SFpTFyGTdQQ1NgV80E3BJzojOcuZVBMq7TnKvSJxw6EkzylARWON832jAF Ofwu3SgWDkeQE5VMmmH8yEdZ0Z1JC8Q/yK+Vm0rWtMX6LLtgLCcqJ9oeK6LlSw== 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=1714073615; 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=cbku9ZNc7U2P5sy6evPDxjMMX5vsgDfT8baYueUTGT4=; b=gDCIb/7WKbMlqKygS40sw8s1QpCwIDHy73nCTdRr8ZD8O7dNRUco+CgEoA+AVqO3oPL8gB Gqs8sCoP4GGd8ft2u+YW9qxqePlobByImwBpvCQpATysKyJRyH/KCRE2Zr1hPWdZ3mJpYk k85RqIzGWpDmwPQgwuJ0w0X45Ga6VslYuLQ8XMWoqJ1dDVmG0H8xNFvh2Nf8k1mBFvl2Vo VnV7edV/HCHKiym+gHmxgQraJhQHo3xQ375ssVTj0L0f2ibmc2Y4/Iy59ZI6kL5cZAoAn4 CDa3LEBJmp5lZ1EpL8vM3OjPMTeV48KWQ1iWAhhumxrfpOca60QjeQmvcALCYQ== 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 4VQQy74L6Pz1BjL; Thu, 25 Apr 2024 19:33:35 +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 43PJXZrl033697; Thu, 25 Apr 2024 19:33:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43PJXZv3033694; Thu, 25 Apr 2024 19:33:35 GMT (envelope-from git) Date: Thu, 25 Apr 2024 19:33:35 GMT Message-Id: <202404251933.43PJXZv3033694@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: 8efba70d7914 - main - nfscl: Revert part of commit 196787f79e67 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 8efba70d7914324890b1f8fe3079036eb2b5c3db Auto-Submitted: auto-generated The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=8efba70d7914324890b1f8fe3079036eb2b5c3db commit 8efba70d7914324890b1f8fe3079036eb2b5c3db Author: Rick Macklem AuthorDate: 2024-04-25 19:32:02 +0000 Commit: Rick Macklem CommitDate: 2024-04-25 19:32:02 +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. MFC after: 3 days --- 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