ksmbd: set fixed sector size to FS_SECTOR_SIZE_INFORMATION
authorNamjae Jeon <linkinjeon@kernel.org>
Wed, 13 Apr 2022 01:01:36 +0000 (10:01 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 9 May 2022 07:14:40 +0000 (09:14 +0200)
commitd276bcc5f72e2adbee921d5313c15b790da59ef0
tree1eea77d944cb37949ca6d27dc5d9a948fdbcac5b
parentdf30cbfd3d8a70e61ce59f63ce5ed2261799ac10
ksmbd: set fixed sector size to FS_SECTOR_SIZE_INFORMATION

[ Upstream commit 02655a70b7cc0f534531ee65fa72692f4d31a944 ]

Currently ksmbd is using ->f_bsize from vfs_statfs() as sector size.
If fat/exfat is a local share, ->f_bsize is a cluster size that is too
large to be used as a sector size. Sector sizes larger than 4K cause
problem occurs when mounting an iso file through windows client.

The error message can be obtained using Mount-DiskImage command,
 the error is:
"Mount-DiskImage : The sector size of the physical disk on which the
virtual disk resides is not supported."

This patch reports fixed 4KB sector size if ->s_blocksize is bigger
than 4KB.

Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/ksmbd/smb2pdu.c