]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 24 Jul 2025 06:58:42 +0000 (08:58 +0200)
commitdceebcfeaa286c2a46e2b97faba065498b423c97
tree7a359953c7f9bf4e352443ee41515cae4b3364e0
parentf0dd353d47f7051afa98c6c60c7486831eb1a410
cifs: Fix reading into an ITER_FOLIOQ from the smbdirect code

commit 263debecb4aa7cec0a86487e6f409814f6194a21 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/smb/client/smbdirect.c