Regarding to how ksmbd handles sector size request from windows cllient

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Christoph,

I have a question about the problem of poking into the block layer in ksmbd.

There is FileFsSectorSizeInformation command in SMB. And MS-FSCC
Specification describe it like the following.

FileFsSectorSizeInformation : This information class is used to query
for the extended sector size and alignment information for a volume.

------------------------------------------------>8----------------------------------------------------------------
/* sector size info struct */
struct smb3_fs_ss_info {
        __le32 LogicalBytesPerSector;
        __le32 PhysicalBytesPerSectorForAtomicity;
        __le32 PhysicalBytesPerSectorForPerf;
        __le32 FSEffPhysicalBytesPerSectorForAtomicity;
        __le32 Flags;
        __le32 ByteOffsetForSectorAlignment;
        __le32 ByteOffsetForPartitionAlignment;
} __packed;

LogicalBytesPerSector (4 bytes): A 32-bit unsigned integer that
contains the number of bytes in a logical sector for the device
backing the volume. This field is the unit of logical addressing for
the device and is not the unit of atomic write. Applications SHOULD
NOT utilize this value for operations requiring physical sector
alignment.

PhysicalBytesPerSectorForAtomicity (4 bytes): A 32-bit unsigned
integer that contains the
number of bytes in a physical sector for the device backing the
volume. Note that this is the
reported physical sector size of the device and is the unit of atomic
write. Applications
SHOULD<152> utilize this value for operations requiring sector alignment.
---------------------------------------------------------------------------------------------------------------------

I have received a report that the problem occurs when mounting an iso
file through windows client on ksmbd & zfs share.

https://github.com/cifsd-team/ksmbd-tools/issues/233

More detailed 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."

zfs block size is 128KB, and there is a problem when ksmbd responds to
this value as a sector size to the windows client.
This seems to judge as an error when a Windows client requests sector
size information from the server and receives a value larger than 4KB.

If the logical/physical_block_size is obtained from the block layer in
ksmbd, You might think of this as a layer violation.
e.g. i_sb->s_bdev->bd_disk->queue->limits.logical_block_size.

So I am confused as to how to fix this issue. and I'd like to hear
your thoughts on how to fix this correctly.

Thanks!



[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux