From patchwork Wed Jul 13 22:15:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trond Myklebust X-Patchwork-Id: 12917172 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 54463C43334 for ; Wed, 13 Jul 2022 22:21:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236726AbiGMWVk (ORCPT ); Wed, 13 Jul 2022 18:21:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56290 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229601AbiGMWVj (ORCPT ); Wed, 13 Jul 2022 18:21:39 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F15172A731 for ; Wed, 13 Jul 2022 15:21:38 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 891F560F05 for ; Wed, 13 Jul 2022 22:21:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B44CBC34114 for ; Wed, 13 Jul 2022 22:21:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657750897; bh=DR1AFiwUVk8DRBOGw7sdQE6dn/plxgKVPdjF5ohuf0A=; h=From:To:Subject:Date:From; b=Xfd0V9VI+HPmnbKxwkbY3yC8cdJldRUdhlc0tWoCzBttf39NbQVRneNC0+32LURRe XT3CwjznjkdEDcHei2xYwNSfB1VcAO32ZdB0l1Xo0sEasO1TxsIba+O9OwSyMCR/i+ Z0f5Wl/FRkaSux4NQfTp8gJ9svWdB/7LMJcXNnUu1UM2HmQzeRHXOGL6rC4hFM0aJD bF/4V1UCUsLtbbW5R2fqTe9vFLq+lc4IvlQ4xDBIIJQ++GZYskSIUJnrZ15jMVnAYi zzCPcEjeIQnMg53rHpU/OvjxR9XOj4e9Td0aA5eCn3cmkQWAQCkG4+dGOWHffcExBX 2smhuF+KRGLFw== From: trondmy@kernel.org To: linux-nfs@vger.kernel.org Subject: [PATCH 1/2] NFSv4.1: Don't decrease the value of seq_nr_highest_sent Date: Wed, 13 Jul 2022 18:15:10 -0400 Message-Id: <20220713221511.1038552-1-trondmy@kernel.org> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Trond Myklebust When we're trying to figure out what the server may or may not have seen in terms of request numbers, do not assume that requests with a larger number were missed, just because we saw a reply to a request with a smaller number. Fixes: 3453d5708b33 ("NFSv4.1: Avoid false retries when RPC calls are interrupted") Signed-off-by: Trond Myklebust --- fs/nfs/nfs4proc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index bb0e84a46d61..628471d06947 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -784,10 +784,9 @@ static void nfs4_slot_sequence_record_sent(struct nfs4_slot *slot, if ((s32)(seqnr - slot->seq_nr_highest_sent) > 0) slot->seq_nr_highest_sent = seqnr; } -static void nfs4_slot_sequence_acked(struct nfs4_slot *slot, - u32 seqnr) +static void nfs4_slot_sequence_acked(struct nfs4_slot *slot, u32 seqnr) { - slot->seq_nr_highest_sent = seqnr; + nfs4_slot_sequence_record_sent(slot, seqnr); slot->seq_nr_last_acked = seqnr; } From patchwork Wed Jul 13 22:15:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trond Myklebust X-Patchwork-Id: 12917173 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E6202C433EF for ; Wed, 13 Jul 2022 22:21:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236879AbiGMWVm (ORCPT ); Wed, 13 Jul 2022 18:21:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229601AbiGMWVl (ORCPT ); Wed, 13 Jul 2022 18:21:41 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1DE8A2A731 for ; Wed, 13 Jul 2022 15:21:41 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C84B4B82089 for ; Wed, 13 Jul 2022 22:21:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2F34FC3411E for ; Wed, 13 Jul 2022 22:21:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657750898; bh=mODro8g6cxVPv/00s6JgCXR4NU0V8jyQjeBRaE7/0mc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=gSl8tod2PQJHz+Bk/UFrbuLL4skGT3NR+tpnVgTl9j2sn4P9AA/1SmOvMG5b+58Mf EnLwy/qppSRuPOKIZItO+9P7k1NXhTVIonvGBW/WIibKcdVZJ8JvqVmNJiB2euDr2+ Ah1guo8b8sSWPUEcK2C9wiWrznhjy3CjQs10De1+sz967Q9awWyPxMLTwvnxblW+l9 2hCSo0lmYvOPAwERtCNM3rYGsB2TWB3H2Ql60n6y0CqvmrEIWc1jAez5UbHnVgIDMX Oz/5o5wYjxUHa1/hhOTfpm8bRptMzVx5BIUDDfqhSXZ2Dcl7Q9l7J6tP4yHYvGCq7j lfWpUEx7YzOpg== From: trondmy@kernel.org To: linux-nfs@vger.kernel.org Subject: [PATCH 2/2] NFSv4.1: Handle NFS4ERR_DELAY replies to OP_SEQUENCE correctly Date: Wed, 13 Jul 2022 18:15:11 -0400 Message-Id: <20220713221511.1038552-2-trondmy@kernel.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220713221511.1038552-1-trondmy@kernel.org> References: <20220713221511.1038552-1-trondmy@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Trond Myklebust Don't assume that the NFS4ERR_DELAY means that the server is processing this slot id. Fixes: 3453d5708b33 ("NFSv4.1: Avoid false retries when RPC calls are interrupted") Signed-off-by: Trond Myklebust --- fs/nfs/nfs4proc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 628471d06947..4e0dcc19ca71 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -853,7 +853,6 @@ static int nfs41_sequence_process(struct rpc_task *task, __func__, slot->slot_nr, slot->seq_nr); - nfs4_slot_sequence_acked(slot, slot->seq_nr); goto out_retry; case -NFS4ERR_RETRY_UNCACHED_REP: case -NFS4ERR_SEQ_FALSE_RETRY: