From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2139D1DF271; Sun, 1 Mar 2026 01:54:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772330052; cv=none; b=hIKd+CUd2EWryBsEavxNT1x020kOGT1Y+USYZVqocsEp6gdNLVumZQjIUFlgdLPLvJG+7Z4a9YZcijfC/QmV6I8M/g4u7at7IT+ZX45crELM/Wb2sjWWuVvYHHnAjc7xLIoKlAcK8zZwDx1bheHtJ/yRo/6QIzE/pHwayTbXEjc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772330052; c=relaxed/simple; bh=JTnHmj/PD4g00NFdG7rv5A+LgfhAacl+Z0Uw8r653hg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=XNmJn02vZEcNQx0ZNwZ/2/xf1jzlEi31ydeO1JvKyZIjI8F7Iqlpyr9U92i7AOFBWZ8Gkh/crSCoTHqpDlhwA7y0iExb2QcAOEqkBf4b16H6V9YjONRuxmW3rH1nvCahPwFY0vQy90YfChdzqfve0BSJkqXtROG8ULkiKqWQYII= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=k3jlE7mq; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="k3jlE7mq" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 16FE0C19421; Sun, 1 Mar 2026 01:54:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772330052; bh=JTnHmj/PD4g00NFdG7rv5A+LgfhAacl+Z0Uw8r653hg=; h=From:To:Cc:Subject:Date:From; b=k3jlE7mqZyMFex2/m3IqRyjfvu4TT8LAajuhNoabART9uD1uw5YC7l0YyZBBGpiXq dBGXrmeZv0WuCMCM9B/tMdv/sDi9WySqJDvBkkbJL9NH5FaHRn8XR1ffIUyo21DUlV sSdWu9/T2qfIWWwdhGu4YyMye2PMuE70OMZcAhz5R7YlTY5QDCe6SYwJzW8Zwf27I4 veKRe4GiGKx4lvrK8/tPXY0K2Gf/5hfL0zYnrC5BN9TN34YEG5ONhF6M6cZVzy0Mff fRskSnp8mNu4R5da2/fUWuLwnAiymH+voDK01De3ey3TVZgRMq9igFxV+u3NJbBsQ7 /pGdLBh3u6VRw== From: Sasha Levin To: stable@vger.kernel.org, metze@samba.org Cc: Steve French , Tom Talpey , Long Li , Namjae Jeon , linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, Steve French Subject: FAILED: Patch "smb: smbdirect: introduce smbdirect_socket.send_io.bcredits.*" failed to apply to 5.15-stable tree Date: Sat, 28 Feb 2026 20:54:09 -0500 Message-ID: <20260301015409.1721101-1-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Hint: ignore X-stable: review Content-Transfer-Encoding: 8bit The patch below does not apply to the 5.15-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . Thanks, Sasha ------------------ original commit in Linus's tree ------------------ >From 8e94268b21c8235d430ce1aa6dc0b15952744b9b Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 22 Jan 2026 18:16:42 +0100 Subject: [PATCH] smb: smbdirect: introduce smbdirect_socket.send_io.bcredits.* It turns out that our code will corrupt the stream of reassabled data transfer messages when we trigger an immendiate (empty) send. In order to fix this we'll have a single 'batch' credit per connection. And code getting that credit is free to use as much messages until remaining_length reaches 0, then the batch credit it given back and the next logical send can happen. Cc: # 6.18.x Cc: Steve French Cc: Tom Talpey Cc: Long Li Cc: Namjae Jeon Cc: linux-cifs@vger.kernel.org Cc: samba-technical@lists.samba.org Signed-off-by: Stefan Metzmacher Acked-by: Namjae Jeon Signed-off-by: Steve French --- fs/smb/common/smbdirect/smbdirect_socket.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/fs/smb/common/smbdirect/smbdirect_socket.h b/fs/smb/common/smbdirect/smbdirect_socket.h index 403a8b2cd30e4..95265192bb01b 100644 --- a/fs/smb/common/smbdirect/smbdirect_socket.h +++ b/fs/smb/common/smbdirect/smbdirect_socket.h @@ -162,6 +162,17 @@ struct smbdirect_socket { mempool_t *pool; } mem; + /* + * This is a coordination for smbdirect_send_batch. + * + * There's only one possible credit, which means + * only one instance is running at a time. + */ + struct { + atomic_t count; + wait_queue_head_t wait_queue; + } bcredits; + /* * The local credit state for ib_post_send() */ @@ -371,6 +382,9 @@ static __always_inline void smbdirect_socket_init(struct smbdirect_socket *sc) INIT_DELAYED_WORK(&sc->idle.timer_work, __smbdirect_socket_disabled_work); disable_delayed_work_sync(&sc->idle.timer_work); + atomic_set(&sc->send_io.bcredits.count, 0); + init_waitqueue_head(&sc->send_io.bcredits.wait_queue); + atomic_set(&sc->send_io.lcredits.count, 0); init_waitqueue_head(&sc->send_io.lcredits.wait_queue); @@ -485,6 +499,8 @@ struct smbdirect_send_batch { */ bool need_invalidate_rkey; u32 remote_key; + + int credit; }; struct smbdirect_recv_io { -- 2.51.0