Re: [PATCH 02/10] block: virtio-blk: check logical block size

2020-07-28 Thread Martin K. Petersen
Hi Maxim, > Instead of this adding blk_is_valid_logical_block_size allowed me to > trivially convert most of the uses. > > For RFC I converted only some drivers that I am more familiar with > and/or can test but I can remove the driver's own checks in most other > drivers with low chance of

Re: [PATCH 02/10] block: virtio-blk: check logical block size

2020-07-28 Thread Stefan Hajnoczi
On Tue, Jul 21, 2020 at 01:52:31PM +0300, Maxim Levitsky wrote: > Linux kernel only supports logical block sizes which are power of two, > at least 512 bytes and no more that PAGE_SIZE. > > Check this instead of crashing later on. > > Note that there is no need to check physical block size since

Re: [PATCH 02/10] block: virtio-blk: check logical block size

2020-07-28 Thread Maxim Levitsky
On Wed, 2020-07-22 at 12:11 +0300, Maxim Levitsky wrote: > On Tue, 2020-07-21 at 22:55 -0400, Martin K. Petersen wrote: > > Christoph, > > > > > Hmm, I wonder if we should simply add the check and warning to > > > blk_queue_logical_block_size and add an error in that case. Then > > > drivers

Re: [PATCH 02/10] block: virtio-blk: check logical block size

2020-07-22 Thread Maxim Levitsky
On Tue, 2020-07-21 at 22:55 -0400, Martin K. Petersen wrote: > Christoph, > > > Hmm, I wonder if we should simply add the check and warning to > > blk_queue_logical_block_size and add an error in that case. Then > > drivers only have to check the error return, which might add a lot > > less

Re: [PATCH 02/10] block: virtio-blk: check logical block size

2020-07-21 Thread Martin K. Petersen
Christoph, > Hmm, I wonder if we should simply add the check and warning to > blk_queue_logical_block_size and add an error in that case. Then > drivers only have to check the error return, which might add a lot > less boiler plate code. Yep, I agree. -- Martin K. Petersen Oracle Linux

Re: [PATCH 02/10] block: virtio-blk: check logical block size

2020-07-21 Thread Christoph Hellwig
On Tue, Jul 21, 2020 at 01:52:31PM +0300, Maxim Levitsky wrote: > Linux kernel only supports logical block sizes which are power of two, > at least 512 bytes and no more that PAGE_SIZE. > > Check this instead of crashing later on. > > Note that there is no need to check physical block size since

Re: [PATCH 02/10] block: virtio-blk: check logical block size

2020-07-21 Thread Damien Le Moal
On 2020/07/21 19:54, Maxim Levitsky wrote: > Linux kernel only supports logical block sizes which are power of two, > at least 512 bytes and no more that PAGE_SIZE. > > Check this instead of crashing later on. > > Note that there is no need to check physical block size since it is > only a hint,

[PATCH 02/10] block: virtio-blk: check logical block size

2020-07-21 Thread Maxim Levitsky
Linux kernel only supports logical block sizes which are power of two, at least 512 bytes and no more that PAGE_SIZE. Check this instead of crashing later on. Note that there is no need to check physical block size since it is only a hint, and virtio-blk already only supports power of two