From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796383050; b=UNS8a9COZrTBAHt9XkRePUsT91Fa9THyJbGSnKmFcOrlGyi01q0s2VZ9kBhmJFaTLOm3 GrovTJVNETbjzrDRb5kk8Z7C1XMnTMzkDIHXWb8HdSgB6hJUxzOSOlZOTMTluPxOI1aWR Vo2y/5zvrCWZSj8r/cZWouh3A42xtalXMuaYE+7WnYNqUME7Z/QTBhTjalJKB2qbaQMTO gHF48oETPWR2p6wiUf6300SgvJYJr+3jyjQJiR+RZYbi17s6FbMX0yeOkGdXLszZZIYUx rGQnTysIpRqglBLjVPFOhEgAMXhh678+0VkYvdwaRzTd5CnDxVXhTkeKIrCVP5CUotA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796383050; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=YvmifiHt+gUCr5qpw3VE92hkw1QUv7CAoPFCDuIpR5k=; b=jsA087/z5uoVWiSj+AIw69LZ1QSkb5XWQdRfHhneWXWBpXZv6rzC/Dyr97OZOIvJ4bFr +44wU6pCYUzoJmvwmLeD0N9e0IuiGDdFZUghaP8T0svj0XF5EI1nQWMuilenqt+rFVCRk MM4jLSaFMamV/Wq7n0YGY9iOQklFWcN24a+JlRRpJX7zOvQ1117FAjH76NthzngZuFQny N7tuXcyXeFSg4OTgwb2GZIgtv1nSOgWoitae1vmoMZENEuPLdG+hNI1Epnpcky85dHQfT rukp8tODRDXS64b1thfSdj4Qs4wZFWTUaSNGZsjb3f7emYnZvIGXrvyE5u2lq5l7Idw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=zctwFl7e; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D24FD606A332; Fri, 4 Dec 2026 11:17:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=zctwFl7e Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4D0871F00939; Fri, 4 Dec 2026 11:17:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796383050; bh=YvmifiHt+gUCr5qpw3VE92hkw1QUv7CAoPFCDuIpR5k=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=zctwFl7e/uvd/IreMv6o4sc/YbBKKBoDIek+aHUdxVRypJLw9SwYNgao3QX+vt4T8 3T1NAWY5vXrByMFRRLBWTxFohj5rZpskbrv8R4v35t2Ssi2TLkFQIRBwq0MrgHpCXj 2tD9iFav361EtBG5pqsxyNaeVb6qPh4bIjPqsGng= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Paulo Alcantara Subject: [PATCH 6.18 703/703] smb: client: dont spend read retries on reads cut short by a reconnect Date: Fri, 4 Dec 2026 19:10:02 +0900 Message-ID: <20261204100646.547086056@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100627.522266145@linuxfoundation.org> References: <20261204100627.522266145@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Paulo Alcantara commit 1d4fcbfad120ddc30b81651f12096bfc84052f9a upstream. smb2_readv_callback() always retries a read cut short by a reconnect, but still asks cifs_io_should_replay() whether to mark it as a replay. On a soft mount that spends one of the mount's retransmissions and grows the backoff, so a later replayable error on the reissued read can fail it early. Mark such reads as replays without consulting the mount's retries, as already done for writes. Fixes: 2c1238a7477a ("cifs: make retry logic in read/write path consistent with other paths") Signed-off-by: Paulo Alcantara Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- fs/smb/client/smb2pdu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/fs/smb/client/smb2pdu.c +++ b/fs/smb/client/smb2pdu.c @@ -4660,6 +4660,7 @@ smb2_readv_callback(struct mid_q_entry * struct smb_rqst rqst = { .rq_iov = &rdata->iov[1], .rq_nvec = 1 }; unsigned int rreq_debug_id = rdata->rreq->debug_id; unsigned int subreq_debug_index = rdata->subreq.debug_index; + bool cut_short = false; if (rdata->got_bytes) { rqst.rq_iter = rdata->subreq.io_iter; @@ -4708,6 +4709,7 @@ smb2_readv_callback(struct mid_q_entry * trace_netfs_sreq(&rdata->subreq, netfs_sreq_trace_io_retry_needed); do_retry: __set_bit(NETFS_SREQ_NEED_RETRY, &rdata->subreq.flags); + cut_short = true; rdata->result = -EAGAIN; if (server->sign && rdata->got_bytes) /* reset bytes number since we can not check a sign */ @@ -4779,7 +4781,7 @@ do_retry: /* see if we need to retry */ if (is_replayable_error(rdata->result) && - cifs_io_should_replay(rdata)) + (cut_short || cifs_io_should_replay(rdata))) rdata->replay = true; trace_smb3_rw_credits(rreq_debug_id, subreq_debug_index, rdata->credits.value,