]> www.infradead.org Git - users/jedix/linux-maple.git/commit
cifs: Fix reading into an ITER_FOLIOQ from the smbdirect code
authorDavid Howells <dhowells@redhat.com>
Wed, 2 Apr 2025 19:27:26 +0000 (20:27 +0100)
committerSteve French <stfrench@microsoft.com>
Thu, 26 Jun 2025 16:13:16 +0000 (11:13 -0500)
commit263debecb4aa7cec0a86487e6f409814f6194a21
tree5335c6285e11d826d65ab0a98212bfa4526e0464
parent43e7e284fc77b710d899569360ea46fa3374ae22
cifs: Fix reading into an ITER_FOLIOQ from the smbdirect code

When performing a file read from RDMA, smbd_recv() prints an "Invalid msg
type 4" error and fails the I/O.  This is due to the switch-statement there
not handling the ITER_FOLIOQ handed down from netfslib.

Fix this by collapsing smbd_recv_buf() and smbd_recv_page() into
smbd_recv() and just using copy_to_iter() instead of memcpy().  This
future-proofs the function too, in case more ITER_* types are added.

Fixes: ee4cdf7ba857 ("netfs: Speed up buffered reading")
Reported-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Tom Talpey <tom@talpey.com>
cc: Paulo Alcantara (Red Hat) <pc@manguebit.com>
cc: Matthew Wilcox <willy@infradead.org>
cc: linux-cifs@vger.kernel.org
cc: netfs@lists.linux.dev
cc: linux-fsdevel@vger.kernel.org
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/smbdirect.c