Re: [PATCH 02/26] sd: move zone limits setup out of sd_read_block_characteristics

2024-06-16 Thread Damien Le Moal
On 6/17/24 13:53, Christoph Hellwig wrote: > On Mon, Jun 17, 2024 at 08:01:04AM +0900, Damien Le Moal wrote: >> On 6/13/24 18:39, Christoph Hellwig wrote: >>> On Tue, Jun 11, 2024 at 02:51:24PM +0900, Damien Le Moal wrote: > + if (sdkp->device->type == TYPE_ZBC) Nit: use sd_is_zoned()

Re: [PATCH 02/26] sd: move zone limits setup out of sd_read_block_characteristics

2024-06-16 Thread Christoph Hellwig
On Mon, Jun 17, 2024 at 08:01:04AM +0900, Damien Le Moal wrote: > On 6/13/24 18:39, Christoph Hellwig wrote: > > On Tue, Jun 11, 2024 at 02:51:24PM +0900, Damien Le Moal wrote: > >>> + if (sdkp->device->type == TYPE_ZBC) > >> > >> Nit: use sd_is_zoned() here ? > > > > Actually - is there much in e

Re: [PATCH 02/26] sd: move zone limits setup out of sd_read_block_characteristics

2024-06-16 Thread Damien Le Moal
On 6/13/24 18:39, Christoph Hellwig wrote: > On Tue, Jun 11, 2024 at 02:51:24PM +0900, Damien Le Moal wrote: >>> + if (sdkp->device->type == TYPE_ZBC) >> >> Nit: use sd_is_zoned() here ? > > Actually - is there much in even keeping sd_is_zoned now that the > host aware support is removed? Just

Re: [PATCH 02/26] sd: move zone limits setup out of sd_read_block_characteristics

2024-06-13 Thread Christoph Hellwig
On Tue, Jun 11, 2024 at 02:51:24PM +0900, Damien Le Moal wrote: > > + if (sdkp->device->type == TYPE_ZBC) > > Nit: use sd_is_zoned() here ? Actually - is there much in even keeping sd_is_zoned now that the host aware support is removed? Just open coding the type check isn't any more code, and

Re: [PATCH 02/26] sd: move zone limits setup out of sd_read_block_characteristics

2024-06-11 Thread Christoph Hellwig
On Tue, Jun 11, 2024 at 02:51:24PM +0900, Damien Le Moal wrote: > > - if (!sd_is_zoned(sdkp)) > > + if (!sd_is_zoned(sdkp)) { > > + lim->zoned = false; > > Maybe we should clear the other zone related limits here ? If the drive is > reformatted/converted from SMR to CMR (FORMAT WITH

Re: [PATCH 02/26] sd: move zone limits setup out of sd_read_block_characteristics

2024-06-11 Thread Hannes Reinecke
On 6/11/24 07:19, Christoph Hellwig wrote: Move a bit of code that sets up the zone flag and the write granularity into sd_zbc_read_zones to be with the rest of the zoned limits. Signed-off-by: Christoph Hellwig --- drivers/scsi/sd.c | 21 + drivers/scsi/sd_zbc.c | 13

Re: [PATCH 02/26] sd: move zone limits setup out of sd_read_block_characteristics

2024-06-11 Thread Damien Le Moal
On 6/11/24 2:54 PM, Christoph Hellwig wrote: > On Tue, Jun 11, 2024 at 07:52:39AM +0200, Christoph Hellwig wrote: >>> Maybe we should clear the other zone related limits here ? If the drive is >>> reformatted/converted from SMR to CMR (FORMAT WITH PRESET), the other zone >>> limits may be set alrea

Re: [PATCH 02/26] sd: move zone limits setup out of sd_read_block_characteristics

2024-06-11 Thread Damien Le Moal
On 6/11/24 2:52 PM, Christoph Hellwig wrote: > On Tue, Jun 11, 2024 at 02:51:24PM +0900, Damien Le Moal wrote: >>> - if (lim->zoned) >>> + if (sdkp->device->type == TYPE_ZBC) >> >> Nit: use sd_is_zoned() here ? > > Yes. > >>> - if (!sd_is_zoned(sdkp)) >>> + if (!sd_is_zoned(sdkp)) { >>> +

Re: [PATCH 02/26] sd: move zone limits setup out of sd_read_block_characteristics

2024-06-10 Thread Christoph Hellwig
On Tue, Jun 11, 2024 at 07:52:39AM +0200, Christoph Hellwig wrote: > > Maybe we should clear the other zone related limits here ? If the drive is > > reformatted/converted from SMR to CMR (FORMAT WITH PRESET), the other zone > > limits may be set already, no ? > > blk_validate_zoned_limits already

Re: [PATCH 02/26] sd: move zone limits setup out of sd_read_block_characteristics

2024-06-10 Thread Christoph Hellwig
On Tue, Jun 11, 2024 at 02:51:24PM +0900, Damien Le Moal wrote: > > - if (lim->zoned) > > + if (sdkp->device->type == TYPE_ZBC) > > Nit: use sd_is_zoned() here ? Yes. > > - if (!sd_is_zoned(sdkp)) > > + if (!sd_is_zoned(sdkp)) { > > + lim->zoned = false; > > Maybe we should cl

Re: [PATCH 02/26] sd: move zone limits setup out of sd_read_block_characteristics

2024-06-10 Thread Damien Le Moal
On 6/11/24 2:19 PM, Christoph Hellwig wrote: > Move a bit of code that sets up the zone flag and the write granularity > into sd_zbc_read_zones to be with the rest of the zoned limits. > > Signed-off-by: Christoph Hellwig > --- > drivers/scsi/sd.c | 21 + > drivers/scsi/s

[PATCH 02/26] sd: move zone limits setup out of sd_read_block_characteristics

2024-06-10 Thread Christoph Hellwig
Move a bit of code that sets up the zone flag and the write granularity into sd_zbc_read_zones to be with the rest of the zoned limits. Signed-off-by: Christoph Hellwig --- drivers/scsi/sd.c | 21 + drivers/scsi/sd_zbc.c | 13 - 2 files changed, 13 insertions(