All of lore.kernel.org
 help / color / mirror / Atom feed
* Regarding to how ksmbd handles sector size request from windows cllient
@ 2022-03-30  7:53 Namjae Jeon
  2022-03-30  9:05 ` Christoph Hellwig
  2022-03-30 12:09 ` Tom Talpey
  0 siblings, 2 replies; 7+ messages in thread
From: Namjae Jeon @ 2022-03-30  7:53 UTC (permalink / raw)
  To: Christoph Hellwig, Christoph Hellwig
  Cc: Steve French, CIFS, Hyeoncheol Lee, Sergey Senozhatsky, Tom Talpey

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!

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Regarding to how ksmbd handles sector size request from windows cllient
  2022-03-30  7:53 Regarding to how ksmbd handles sector size request from windows cllient Namjae Jeon
@ 2022-03-30  9:05 ` Christoph Hellwig
  2022-03-30 13:46   ` Namjae Jeon
  2022-03-30 12:09 ` Tom Talpey
  1 sibling, 1 reply; 7+ messages in thread
From: Christoph Hellwig @ 2022-03-30  9:05 UTC (permalink / raw)
  To: Namjae Jeon
  Cc: Christoph Hellwig, Christoph Hellwig, Steve French, CIFS,
	Hyeoncheol Lee, Sergey Senozhatsky, Tom Talpey

On Wed, Mar 30, 2022 at 04:53:32PM +0900, Namjae Jeon wrote:
> I have received a report that the problem occurs when mounting an iso
> file through windows client on ksmbd & zfs share.

ZFS violates the kernels licene.  Please tell the reported to go away
as this is completely unsupported.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Regarding to how ksmbd handles sector size request from windows cllient
  2022-03-30  7:53 Regarding to how ksmbd handles sector size request from windows cllient Namjae Jeon
  2022-03-30  9:05 ` Christoph Hellwig
@ 2022-03-30 12:09 ` Tom Talpey
  2022-03-30 23:32   ` Namjae Jeon
  1 sibling, 1 reply; 7+ messages in thread
From: Tom Talpey @ 2022-03-30 12:09 UTC (permalink / raw)
  To: Namjae Jeon, Christoph Hellwig, Christoph Hellwig
  Cc: Steve French, CIFS, Hyeoncheol Lee, Sergey Senozhatsky

On 3/30/2022 3:53 AM, Namjae Jeon wrote:
> 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.
This sounds like a problem common to any LVM or RAID layering.
What does a Windows server return for a volume on a Storage Space?
Look to that for guidance.

Tom.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Regarding to how ksmbd handles sector size request from windows cllient
  2022-03-30  9:05 ` Christoph Hellwig
@ 2022-03-30 13:46   ` Namjae Jeon
  0 siblings, 0 replies; 7+ messages in thread
From: Namjae Jeon @ 2022-03-30 13:46 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Christoph Hellwig, Steve French, CIFS, Hyeoncheol Lee,
	Sergey Senozhatsky, Tom Talpey

2022-03-30 18:05 GMT+09:00, Christoph Hellwig <hch@infradead.org>:
> On Wed, Mar 30, 2022 at 04:53:32PM +0900, Namjae Jeon wrote:
>> I have received a report that the problem occurs when mounting an iso
>> file through windows client on ksmbd & zfs share.
>
> ZFS violates the kernels licene.  Please tell the reported to go away
> as this is completely unsupported.
Okay.
Thanks for your reply:)
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Regarding to how ksmbd handles sector size request from windows cllient
  2022-03-30 12:09 ` Tom Talpey
@ 2022-03-30 23:32   ` Namjae Jeon
  2022-03-30 23:44     ` Tom Talpey
  0 siblings, 1 reply; 7+ messages in thread
From: Namjae Jeon @ 2022-03-30 23:32 UTC (permalink / raw)
  To: Tom Talpey
  Cc: Christoph Hellwig, Christoph Hellwig, Steve French, CIFS,
	Hyeoncheol Lee, Sergey Senozhatsky

2022-03-30 21:09 GMT+09:00, Tom Talpey <tom@talpey.com>:
> On 3/30/2022 3:53 AM, Namjae Jeon wrote:
>> 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.
> This sounds like a problem common to any LVM or RAID layering.
> What does a Windows server return for a volume on a Storage Space?
I'm not sure if windows server & ZFS share is possible. samba & ZFS
respond 512Bytes sector size to client. I don't know why SMB client
need the disk sector size information from server...
> Look to that for guidance.
Okay:)

Thanks!
>
> Tom.
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Regarding to how ksmbd handles sector size request from windows cllient
  2022-03-30 23:32   ` Namjae Jeon
@ 2022-03-30 23:44     ` Tom Talpey
  2022-03-31  4:06       ` Christoph Hellwig
  0 siblings, 1 reply; 7+ messages in thread
From: Tom Talpey @ 2022-03-30 23:44 UTC (permalink / raw)
  To: Namjae Jeon
  Cc: Christoph Hellwig, Christoph Hellwig, Steve French, CIFS,
	Hyeoncheol Lee, Sergey Senozhatsky

I agree with Christof, don't do anything ZFS-specific here. But I was trying to encourage you to think more broadly about the situation, and hopefully find a compatible solution.

Sector size is mostly about application compatibility. If you don't return anything, the app may break. For example, I bet SQL Server issues that info req, and SQL supports running over SMB. So that's one reason.

Tom.

Mar 30, 2022 7:37:20 PM Namjae Jeon <linkinjeon@kernel.org>:

> 2022-03-30 21:09 GMT+09:00, Tom Talpey <tom@talpey.com>:
>> On 3/30/2022 3:53 AM, Namjae Jeon wrote:
>>> 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.
>> This sounds like a problem common to any LVM or RAID layering.
>> What does a Windows server return for a volume on a Storage Space?
> I'm not sure if windows server & ZFS share is possible. samba & ZFS
> respond 512Bytes sector size to client. I don't know why SMB client
> need the disk sector size information from server...
>> Look to that for guidance.
> Okay:)
> 
> Thanks!
>> 
>> Tom.
>> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Regarding to how ksmbd handles sector size request from windows cllient
  2022-03-30 23:44     ` Tom Talpey
@ 2022-03-31  4:06       ` Christoph Hellwig
  0 siblings, 0 replies; 7+ messages in thread
From: Christoph Hellwig @ 2022-03-31  4:06 UTC (permalink / raw)
  To: Tom Talpey
  Cc: Namjae Jeon, Christoph Hellwig, Christoph Hellwig, Steve French,
	CIFS, Hyeoncheol Lee, Sergey Senozhatsky

Leave is as-is.  128kb is not a valid sector size in Linux to start
with.  That is what people get for using weird out of tree crap.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-03-31  4:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-30  7:53 Regarding to how ksmbd handles sector size request from windows cllient Namjae Jeon
2022-03-30  9:05 ` Christoph Hellwig
2022-03-30 13:46   ` Namjae Jeon
2022-03-30 12:09 ` Tom Talpey
2022-03-30 23:32   ` Namjae Jeon
2022-03-30 23:44     ` Tom Talpey
2022-03-31  4:06       ` Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.