]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
smb: server: call smb_direct_post_recv_credits() when the negotiation is done
authorStefan Metzmacher <metze@samba.org>
Mon, 20 Oct 2025 14:07:13 +0000 (16:07 +0200)
committerSteve French <stfrench@microsoft.com>
Mon, 27 Oct 2025 01:47:32 +0000 (20:47 -0500)
commit975f05a7647720b6a82dac73463eaeca3067de71
treefb188ae3b6e3a15e958c5d44942c942c55c6c6f2
parent6f40e50ceb99fc8ef37e5c56e2ec1d162733fef0
smb: server: call smb_direct_post_recv_credits() when the negotiation is done

We now activate sc->recv_io.posted.refill_work and sc->idle.immediate_work
only after a successful negotiation, before sending the negotiation
response.

It means the queue_work(sc->workqueue, &sc->recv_io.posted.refill_work)
in put_recvmsg() of the negotiate request, is a no-op now.

It also means our explicit smb_direct_post_recv_credits() will
have queue_work(sc->workqueue, &sc->idle.immediate_work) as no-op.

This should make sure we don't have races and post any immediate
data_transfer message that tries to grant credits to the peer,
before we send the negotiation response, as that will grant
the initial credits to the peer.

Fixes: 0626e6641f6b ("cifsd: add server handler for central processing and tranport layers")
Fixes: 1cde0a74a7a8 ("smb: server: don't use delayed_work for post_recv_credits_work")
Cc: Namjae Jeon <linkinjeon@kernel.org>
Cc: Steve French <smfrench@gmail.com>
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