From: Stefan Metzmacher <metze@samba.org>
To: David Howells <dhowells@redhat.com>
Cc: smfrench@gmail.com, tom@talpey.com,
Long Li <longli@microsoft.com>,
Namjae Jeon <linkinjeon@kernel.org>,
linux-cifs@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] cifs: Fix problem with encrypted RDMA data read
Date: Wed, 16 Nov 2022 13:53:31 +0100 [thread overview]
Message-ID: <34140d2f-4f1f-0d58-c0ca-eb181ca9fde3@samba.org> (raw)
In-Reply-To: <2780586.1668600891@warthog.procyon.org.uk>
Am 16.11.22 um 13:14 schrieb David Howells:
> Stefan Metzmacher <metze@samba.org> wrote:
>
>>> Stefan Metzmacher <metze@samba.org> wrote:
>>>
>>>> I'm not sure I understand why this would fix anything when encryption is
>>>> enabled.
>>>>
>>>> Is the payload still be offloaded as plaintext? Otherwise we wouldn't have
>>>> use_rdma_mr... So this rather looks like a fix for the non encrypted case.
>>> The "inline"[*] PDUs are encrypted, but the direct RDMA data transmission is
>>> not. I'm not sure if this is a bug in ksmbd.
>>
>> It's a bug in the client!
>
> Well, if you can fix it the right way, I can test the patch. I'm not sure
> what that would be if not what I suggested.
As written in the other mail something like this:
fs/cifs/smb2pdu.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index a5695748a89b..d478b0a89890 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -4090,7 +4090,7 @@ smb2_new_read_req(void **buf, unsigned int *total_len,
* If we want to do a RDMA write, fill in and append
* smbd_buffer_descriptor_v1 to the end of read request
*/
- if (server->rdma && rdata && !server->sign &&
+ if (server->rdma && rdata && !server->sign && !smb3_encryption_required(io_parms->tcon) &&
rdata->bytes >= server->smbd_conn->rdma_readwrite_threshold) {
struct smbd_buffer_descriptor_v1 *v1;
@@ -4517,8 +4517,8 @@ smb2_async_writev(struct cifs_writedata *wdata,
* If we want to do a server RDMA read, fill in and append
* smbd_buffer_descriptor_v1 to the end of write request
*/
- if (server->rdma && !server->sign && wdata->bytes >=
- server->smbd_conn->rdma_readwrite_threshold) {
+ if (server->rdma && !server->sign && !smb3_encryption_required(tcon) &&
+ wdata->bytes >= server->smbd_conn->rdma_readwrite_threshold) {
struct smbd_buffer_descriptor_v1 *v1;
bool need_invalidate = server->dialect == SMB30_PROT_ID;
next prev parent reply other threads:[~2022-11-16 12:53 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-15 22:44 [PATCH] cifs: Fix problem with encrypted RDMA data read David Howells
2022-11-16 0:57 ` Stefan Metzmacher
2022-11-16 5:19 ` Namjae Jeon
2022-11-16 8:36 ` Stefan Metzmacher
2022-11-16 15:41 ` Tom Talpey
2022-11-16 15:44 ` Stefan Metzmacher
2022-11-16 16:14 ` Tom Talpey
2022-11-16 19:53 ` Stefan Metzmacher
2022-11-16 21:21 ` Tom Talpey
2022-11-16 16:44 ` David Howells
2022-11-16 7:00 ` David Howells
2022-11-16 9:05 ` Stefan Metzmacher
2022-11-16 12:14 ` David Howells
2022-11-16 12:53 ` Stefan Metzmacher [this message]
2022-11-16 13:09 ` David Howells
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=34140d2f-4f1f-0d58-c0ca-eb181ca9fde3@samba.org \
--to=metze@samba.org \
--cc=dhowells@redhat.com \
--cc=linkinjeon@kernel.org \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=longli@microsoft.com \
--cc=smfrench@gmail.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox