]> git.ipfire.org Git - thirdparty/linux.git/commit
smb: server: defer the initial recv completion logic to smb_direct_negotiate_recv_work()
authorStefan Metzmacher <metze@samba.org>
Tue, 2 Dec 2025 21:15:26 +0000 (22:15 +0100)
committerSteve French <stfrench@microsoft.com>
Mon, 15 Dec 2025 00:35:55 +0000 (18:35 -0600)
commitd180b1d9c7a401656332b27e3428a949c00748d3
tree367fcfb548b0ce52b023ac8021acab2fb2ebcdee
parentc1fb124f2a7416905047cf36fa6a110f9c48cd02
smb: server: defer the initial recv completion logic to smb_direct_negotiate_recv_work()

The previous change to relax WARN_ON_ONCE(SMBDIRECT_SOCKET_*) checks in
recv_done() and smb_direct_cm_handler() seems to work around the
problem that the order of initial recv completion and
RDMA_CM_EVENT_ESTABLISHED is random, but it's still
a bit ugly.

This implements a better solution deferring the recv completion
processing to smb_direct_negotiate_recv_work(), which is queued
only if both events arrived.

In order to avoid more basic changes to the main recv_done
callback, I introduced a smb_direct_negotiate_recv_done,
which is only used for the first pdu, this will allow
further cleanup and simplifications in recv_done
as a future patch.

smb_direct_negotiate_recv_work() is also very basic
with only basic error checking and the transition
from SMBDIRECT_SOCKET_NEGOTIATE_NEEDED to
SMBDIRECT_SOCKET_NEGOTIATE_RUNNING, which allows
smb_direct_prepare() to continue as before.

Cc: Tom Talpey <tom@talpey.com>
Cc: linux-cifs@vger.kernel.org
Cc: samba-technical@lists.samba.org
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/server/transport_rdma.c