]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
smb: server: let smb_direct_flush_send_list() invalidate a remote key first
authorStefan Metzmacher <metze@samba.org>
Mon, 8 Sep 2025 20:22:35 +0000 (22:22 +0200)
committerSteve French <stfrench@microsoft.com>
Sun, 28 Sep 2025 23:29:54 +0000 (18:29 -0500)
If we want to invalidate a remote key we should do that as soon as
possible, so do it in the first send work request.

Acked-by: 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>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/server/transport_rdma.c

index e78347831d2ffe9fe790f93eebd89657cbee9bbb..27e3fc5139cc71d5cd3280925443e868aa33d742 100644 (file)
@@ -1017,12 +1017,15 @@ static int smb_direct_flush_send_list(struct smbdirect_socket *sc,
                               struct smbdirect_send_io,
                               sibling_list);
 
+       if (send_ctx->need_invalidate_rkey) {
+               first->wr.opcode = IB_WR_SEND_WITH_INV;
+               first->wr.ex.invalidate_rkey = send_ctx->remote_key;
+               send_ctx->need_invalidate_rkey = false;
+               send_ctx->remote_key = 0;
+       }
+
        last->wr.send_flags = IB_SEND_SIGNALED;
        last->wr.wr_cqe = &last->cqe;
-       if (is_last && send_ctx->need_invalidate_rkey) {
-               last->wr.opcode = IB_WR_SEND_WITH_INV;
-               last->wr.ex.invalidate_rkey = send_ctx->remote_key;
-       }
 
        ret = smb_direct_post_send(sc, &first->wr);
        if (!ret) {