From nobody Sun Apr 28 01:37:48 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 4VRpxS5G3sz5HKN6; Sun, 28 Apr 2024 01:37:48 +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 4VRpxS4hYZz4Xxq; Sun, 28 Apr 2024 01:37:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714268268; 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=fVnJiXVE99Br+4XfOzo8LgsGRwTVXvX/AUqckD7cjqk=; b=Kr9mVFg389I46OqCzxSSPqKP6ovCqFuYUcHuKYF1Hrpg+2QV2oKfYi1AZjW9xE5+uFwMGZ OCw1hxZaHK9BwbP5EkCLU7pDPVrpCutX7YHorSJKn41qo+LsipenWEn8sZEnK6kT9RHCpf rtZyIJVQj86m7I0MvwcXptC2ZA5FfEU/YYYftitK3CvFjqLa9ioRYOHGckGw4cTJ8rtHTi 6T5zETP5KGV3z8nSrAgGEi2PvnqcjhuznuVXCDQhJOBc9lNg1SC8g9WqQ5o0FThI3z0vM3 p5M1ZXcTdamD81fp5KttzkzXyFwkrbCoWBDU0Ny34WtTeVRKGYm0kJPu6LLaEg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714268268; a=rsa-sha256; cv=none; b=JgR63Cc8CbUOSbmjGBUFi24b3NVHI92M9nsjJSiyqt8liiUKw/9p/I9nhxeonzNVffezd6 zAlXK0Kb+nhpqFWBZcMq7EX2e5uKOBDgHLG9ZCxQee3F9XxuyD7O0pif+Snm+D243kWjN8 5xPbf6nEdxeo4P5mkzBPmzFFsUl9KzdF8SFgO/jKwhwGhpTyDYCkP9A09x0KXxKPlVAEyU zLQ5nWTPqE6945ujo1fdVq2AhXvHT7FIOibUdkr7y//NgOFIEv04+mEK+/X1lwHTEWWBx3 S976WadIR9R57sKvNZGGyO9Nua75TwwaPqtbMXxrCL+7pufnMep/csk3UOs/oQ== 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=1714268268; 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=fVnJiXVE99Br+4XfOzo8LgsGRwTVXvX/AUqckD7cjqk=; b=Jt1r0kBaHhYbt7Mh5TLuMUULKcPQDtz8xU4o6bljcDmmBLuium5xX7Mx+/4quaIEwhPCPj yGmL9e5ItzKDsw5YbfGrig1xru+ZISkzaiFLsR66zKFJiFffsooqF1HeE9p54Cmp8ZjAts Tduy5qYcn0BabhsGR1pjV2FRe6nyegEuRAm/6+KbxnrPCEHnTrRbaRK4mCthvPIZg8/ZHx mLpYCSCAkmptW1TqzV/d7qTPubgMa0KxIPmMpXqgV1h9nQSTpHQbcy6pR2uoo+iSacWePq 1761K64x19NiFjRsEwN1/KPunMuhfiHE1q61PQ8XWkCN3FNOdxJWGJCD/6tekA== 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 4VRpxS3s1cz15Ks; Sun, 28 Apr 2024 01:37:48 +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 43S1bmRq014017; Sun, 28 Apr 2024 01:37:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43S1bmSd014014; Sun, 28 Apr 2024 01:37:48 GMT (envelope-from git) Date: Sun, 28 Apr 2024 01:37:48 GMT Message-Id: <202404280137.43S1bmSd014014@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: aab71045646b - stable/14 - Revert "nfsd: Fix NFSv4.1/4.2 Claim_Deleg_Cur_FH" 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/stable/14 X-Git-Reftype: branch X-Git-Commit: aab71045646b7cd17a96a4fa73635a558ab40805 Auto-Submitted: auto-generated The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=aab71045646b7cd17a96a4fa73635a558ab40805 commit aab71045646b7cd17a96a4fa73635a558ab40805 Author: Rick Macklem AuthorDate: 2024-04-25 16:41:23 +0000 Commit: Rick Macklem CommitDate: 2024-04-28 01:36:04 +0000 Revert "nfsd: Fix NFSv4.1/4.2 Claim_Deleg_Cur_FH" This reverts commit f300335d9aebf2e99862bf783978bd44ede23550. It turns out that the old code was correct and it was wireshark that was broken and indicated that the RPC's XDR was bogus. Found during IETF bakeathon testing this week. (cherry picked from commit 54c3aa02e926268ba5551cd7d28fddf38b3589a2) --- sys/fs/nfsserver/nfs_nfsdserv.c | 10 ++-------- sys/fs/nfsserver/nfs_nfsdstate.c | 16 ++++------------ 2 files changed, 6 insertions(+), 20 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdserv.c b/sys/fs/nfsserver/nfs_nfsdserv.c index 899e88508b60..8141ee6cbdb6 100644 --- a/sys/fs/nfsserver/nfs_nfsdserv.c +++ b/sys/fs/nfsserver/nfs_nfsdserv.c @@ -3003,18 +3003,12 @@ nfsrvd_open(struct nfsrv_descript *nd, __unused int isdgram, */ NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED); claim = fxdr_unsigned(int, *tl); - if (claim == NFSV4OPEN_CLAIMDELEGATECUR) { + if (claim == NFSV4OPEN_CLAIMDELEGATECUR || claim == + NFSV4OPEN_CLAIMDELEGATECURFH) { NFSM_DISSECT(tl, u_int32_t *, NFSX_STATEID); stateid.seqid = fxdr_unsigned(u_int32_t, *tl++); NFSBCOPY((caddr_t)tl,(caddr_t)stateid.other,NFSX_STATEIDOTHER); stp->ls_flags |= NFSLCK_DELEGCUR; - } else if (claim == NFSV4OPEN_CLAIMDELEGATECURFH) { - /* Fill in most of the stateid from the clientid. */ - stateid.seqid = 0; - stateid.other[0] = clientid.lval[0]; - stateid.other[1] = clientid.lval[1]; - stateid.other[2] = 0; - stp->ls_flags |= NFSLCK_DELEGCUR; } else if (claim == NFSV4OPEN_CLAIMDELEGATEPREV || claim == NFSV4OPEN_CLAIMDELEGATEPREVFH) { stp->ls_flags |= NFSLCK_DELEGPREV; diff --git a/sys/fs/nfsserver/nfs_nfsdstate.c b/sys/fs/nfsserver/nfs_nfsdstate.c index da57ebde7a52..c73840277022 100644 --- a/sys/fs/nfsserver/nfs_nfsdstate.c +++ b/sys/fs/nfsserver/nfs_nfsdstate.c @@ -2568,10 +2568,6 @@ tryagain: /* * For Delegate_Cur, search for the matching Delegation, * which indicates no conflict. - * For NFSv4.1/4.2 Claim_Deleg_Cur_FH only provides - * the clientid, which is the first two "other" elements - * for the stateid. This should be sufficient, since there - * is only one delegation per client and file. * An old delegation should have been recovered by the * client doing a Claim_DELEGATE_Prev, so I won't let * it match and return NFSERR_EXPIRED. Should I let it @@ -2582,8 +2578,8 @@ tryagain: (((nd->nd_flag & ND_NFSV41) != 0 && stateidp->seqid == 0) || stateidp->seqid == stp->ls_stateid.seqid) && - stateidp->other[0] == stp->ls_stateid.other[0] && - stateidp->other[1] == stp->ls_stateid.other[1]) + !NFSBCMP(stateidp->other, stp->ls_stateid.other, + NFSX_STATEIDOTHER)) break; } if (stp == LIST_END(&lfp->lf_deleg) || @@ -2834,10 +2830,6 @@ tryagain: /* * For Delegate_Cur, search for the matching Delegation, * which indicates no conflict. - * For NFSv4.1/4.2 Claim_Deleg_Cur_FH only provides - * the clientid, which is the first two "other" elements - * for the stateid. This should be sufficient, since there - * is only one delegation per client and file. * An old delegation should have been recovered by the * client doing a Claim_DELEGATE_Prev, so I won't let * it match and return NFSERR_EXPIRED. Should I let it @@ -2848,8 +2840,8 @@ tryagain: (((nd->nd_flag & ND_NFSV41) != 0 && stateidp->seqid == 0) || stateidp->seqid == stp->ls_stateid.seqid) && - stateidp->other[0] == stp->ls_stateid.other[0] && - stateidp->other[1] == stp->ls_stateid.other[1]) + !NFSBCMP(stateidp->other, stp->ls_stateid.other, + NFSX_STATEIDOTHER)) break; } if (stp == LIST_END(&lfp->lf_deleg) ||