From: David Howells <dhowells@redhat.com>
To: Stefan Metzmacher <metze@samba.org>
Cc: dhowells@redhat.com, linux-cifs@vger.kernel.org,
samba-technical@lists.samba.org, Steve French <sfrench@samba.org>,
Tom Talpey <tom@talpey.com>,
stable+noautosel@kernel.org
Subject: Re: [PATCH v2] smb: client: let smbd_post_send_iter() respect the peers max_send_size and transmit all data
Date: Wed, 25 Jun 2025 10:01:38 +0100 [thread overview]
Message-ID: <1288833.1750842098@warthog.procyon.org.uk> (raw)
In-Reply-To: <20250625081638.944583-1-metze@samba.org>
Stefan Metzmacher <metze@samba.org> wrote:
> We should not send smbdirect_data_transfer messages larger than
> the negotiated max_send_size, typically 1364 bytes, which means
> 24 bytes of the smbdirect_data_transfer header + 1340 payload bytes.
>
> This happened when doing an SMB2 write with more than 1340 bytes
> (which is done inline as it's below rdma_readwrite_threshold).
>
> It means the peer resets the connection.
>
> When testing between cifs.ko and ksmbd.ko something like this
> is logged:
>
> client:
>
> CIFS: VFS: RDMA transport re-established
> siw: got TERMINATE. layer 1, type 2, code 2
> siw: got TERMINATE. layer 1, type 2, code 2
> siw: got TERMINATE. layer 1, type 2, code 2
> siw: got TERMINATE. layer 1, type 2, code 2
> siw: got TERMINATE. layer 1, type 2, code 2
> siw: got TERMINATE. layer 1, type 2, code 2
> siw: got TERMINATE. layer 1, type 2, code 2
> siw: got TERMINATE. layer 1, type 2, code 2
> siw: got TERMINATE. layer 1, type 2, code 2
> CIFS: VFS: \\carina Send error in SessSetup = -11
> smb2_reconnect: 12 callbacks suppressed
> CIFS: VFS: reconnect tcon failed rc = -11
> CIFS: VFS: reconnect tcon failed rc = -11
> CIFS: VFS: reconnect tcon failed rc = -11
> CIFS: VFS: SMB: Zero rsize calculated, using minimum value 65536
>
> and:
>
> CIFS: VFS: RDMA transport re-established
> siw: got TERMINATE. layer 1, type 2, code 2
> CIFS: VFS: smbd_recv:1894 disconnected
> siw: got TERMINATE. layer 1, type 2, code 2
>
> The ksmbd dmesg is showing things like:
>
> smb_direct: Recv error. status='local length error (1)' opcode=128
> smb_direct: disconnected
> smb_direct: Recv error. status='local length error (1)' opcode=128
> ksmbd: smb_direct: disconnected
> ksmbd: sock_read failed: -107
>
> As smbd_post_send_iter() limits the transmitted number of bytes
> we need loop over it in order to transmit the whole iter.
>
> Cc: Steve French <sfrench@samba.org>
> Cc: David Howells <dhowells@redhat.com>
> Cc: Tom Talpey <tom@talpey.com>
> Cc: linux-cifs@vger.kernel.org
> Cc: <stable+noautosel@kernel.org> # sp->max_send_size should be info->max_send_size in backports
> Fixes: 3d78fe73fa12 ("cifs: Build the RDMA SGE list directly from an iterator")
> Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: David Howells <dhowells@redhat.com>
Tested-by: David Howells <dhowells@redhat.com>
next prev parent reply other threads:[~2025-06-25 9:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-25 8:16 [PATCH v2] smb: client: let smbd_post_send_iter() respect the peers max_send_size and transmit all data Stefan Metzmacher
2025-06-25 9:01 ` David Howells [this message]
2025-06-25 16:17 ` Steve French
2025-06-25 16:53 ` Tom Talpey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1288833.1750842098@warthog.procyon.org.uk \
--to=dhowells@redhat.com \
--cc=linux-cifs@vger.kernel.org \
--cc=metze@samba.org \
--cc=samba-technical@lists.samba.org \
--cc=sfrench@samba.org \
--cc=stable+noautosel@kernel.org \
--cc=tom@talpey.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.