From owner-dev-commits-src-all@freebsd.org Thu Apr 15 21:15:29 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D2BFE5D8B09; Thu, 15 Apr 2021 21:15:29 +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 4FLsZ95c62z4sf9; Thu, 15 Apr 2021 21:15:29 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 B2DA31872E; Thu, 15 Apr 2021 21:15:29 +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 13FLFTp8090835; Thu, 15 Apr 2021 21:15:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13FLFTO9090834; Thu, 15 Apr 2021 21:15:29 GMT (envelope-from git) Date: Thu, 15 Apr 2021 21:15:29 GMT Message-Id: <202104152115.13FLFTO9090834@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: 34256484aff2 - main - Revert "nfsd: cut the Linux NFSv4.1/4.2 some slack w.r.t. RFC5661" 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: 34256484aff285f460a98c089b030228448fe19f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2021 21:15:29 -0000 The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=34256484aff285f460a98c089b030228448fe19f commit 34256484aff285f460a98c089b030228448fe19f Author: Rick Macklem AuthorDate: 2021-04-15 21:08:40 +0000 Commit: Rick Macklem CommitDate: 2021-04-15 21:08:40 +0000 Revert "nfsd: cut the Linux NFSv4.1/4.2 some slack w.r.t. RFC5661" This reverts commit 9edaceca8165e2864267547311daf145bb520270. It turns out that the Linux client intentionally does an NFSv4.1 RPC with only a Sequence operation in it and with "seqid + 1" for the slot. This is used to re-synchronize the slot's seqid and the client expects the NFS4ERR_SEQ_MISORDERED error reply. As such, revert the patch, so that the server remains RFC5661 compliant. --- sys/fs/nfs/nfs_commonsubs.c | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c index d7009b1e0ca4..4afa4c2d9ab4 100644 --- a/sys/fs/nfs/nfs_commonsubs.c +++ b/sys/fs/nfs/nfs_commonsubs.c @@ -98,11 +98,6 @@ int nfs_maxcopyrange = 10 * 1024 * 1024; SYSCTL_INT(_vfs_nfs, OID_AUTO, maxcopyrange, CTLFLAG_RW, &nfs_maxcopyrange, 0, "Max size of a Copy so RPC times reasonable"); -static int nfs_allowskip_sessionseq = 1; -SYSCTL_INT(_vfs_nfs, OID_AUTO, linuxseqsesshack, CTLFLAG_RW, - &nfs_allowskip_sessionseq, 0, "Allow client to skip ahead one seq# for" - " session slot"); - /* * This array of structures indicates, for V4: * retfh - which of 3 types of calling args are used @@ -4619,7 +4614,7 @@ nfsmout: * Handle an NFSv4.1 Sequence request for the session. * If reply != NULL, use it to return the cached reply, as required. * The client gets a cached reply via this call for callbacks, however the - * server gets a cached reply via the nfsv4_seqsess_cacherep() call. + * server gets a cached reply via the nfsv4_seqsess_cachereply() call. */ int nfsv4_seqsession(uint32_t seqid, uint32_t slotid, uint32_t highslot, @@ -4653,24 +4648,12 @@ nfsv4_seqsession(uint32_t seqid, uint32_t slotid, uint32_t highslot, } else /* No reply cached, so just do it. */ slots[slotid].nfssl_inprog = 1; - } else if (slots[slotid].nfssl_seq + 1 == seqid || - (slots[slotid].nfssl_seq + 2 == seqid && - nfs_allowskip_sessionseq != 0)) { - /* - * Allowing the seqid to be ahead by 2 is technically - * a violation of RFC5661, but it seems harmless to do - * and avoids returning NFSERR_SEQMISORDERED to a - * slightly broken Linux NFSv4.1/4.2 client. - * If the RPCs are really out of order, one with a - * lower seqid will be subsequently received and that - * one will get a NFSERR_SEQMISORDERED reply. - * Can be disabled by setting vfs.nfs.linuxseqsesshack to 0. - */ + } else if ((slots[slotid].nfssl_seq + 1) == seqid) { if (slots[slotid].nfssl_reply != NULL) m_freem(slots[slotid].nfssl_reply); slots[slotid].nfssl_reply = NULL; slots[slotid].nfssl_inprog = 1; - slots[slotid].nfssl_seq = seqid; + slots[slotid].nfssl_seq++; } else error = NFSERR_SEQMISORDERED; return (error);