Skip to content

Commit 1b53426

Browse files
metze-sambasmfrench
authored andcommitted
smb: server: let smb_direct_flush_send_list() invalidate a remote key first
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>
1 parent 942ce74 commit 1b53426

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

fs/smb/server/transport_rdma.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,12 +1017,15 @@ static int smb_direct_flush_send_list(struct smbdirect_socket *sc,
10171017
struct smbdirect_send_io,
10181018
sibling_list);
10191019

1020+
if (send_ctx->need_invalidate_rkey) {
1021+
first->wr.opcode = IB_WR_SEND_WITH_INV;
1022+
first->wr.ex.invalidate_rkey = send_ctx->remote_key;
1023+
send_ctx->need_invalidate_rkey = false;
1024+
send_ctx->remote_key = 0;
1025+
}
1026+
10201027
last->wr.send_flags = IB_SEND_SIGNALED;
10211028
last->wr.wr_cqe = &last->cqe;
1022-
if (is_last && send_ctx->need_invalidate_rkey) {
1023-
last->wr.opcode = IB_WR_SEND_WITH_INV;
1024-
last->wr.ex.invalidate_rkey = send_ctx->remote_key;
1025-
}
10261029

10271030
ret = smb_direct_post_send(sc, &first->wr);
10281031
if (!ret) {

0 commit comments

Comments
 (0)