smb: client: ensure aligned IO sizes
authorPaulo Alcantara <pc@manguebit.com>
Wed, 30 Apr 2025 23:15:48 +0000 (20:15 -0300)
committerSteve French <stfrench@microsoft.com>
Thu, 1 May 2025 13:35:58 +0000 (08:35 -0500)
commitc59f7c9661b9d3ee33a21d7b4f1dd4b77079e3e7
tree9f409e6c5438f55fa6b2e309794e49deceb3beea
parentf122121796f91168d0894c2710b8dd71330a34f8
smb: client: ensure aligned IO sizes

Make all IO sizes multiple of PAGE_SIZE, either negotiated by the
server or passed through rsize, wsize and bsize mount options, to
prevent from breaking DIO reads and writes against servers that
enforce alignment as specified in MS-FSA 2.1.5.3 and 2.1.5.4.

Cc: linux-cifs@vger.kernel.org
Reviewed-by: David Howells <dhowells@redhat.com>
Signed-off-by: Paulo Alcantara (Red Hat) <pc@manguebit.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/connect.c
fs/smb/client/file.c
fs/smb/client/fs_context.c
fs/smb/client/fs_context.h
fs/smb/client/smb1ops.c
fs/smb/client/smb2pdu.c