diff mbox series

[1/2] sd: remove the !ZBC && blk_queue_is_zoned case in sd_read_block_characteristics

Message ID 20231228075141.362560-2-hch@lst.de
State New
Headers show
Series [1/2] sd: remove the !ZBC && blk_queue_is_zoned case in sd_read_block_characteristics | expand

Commit Message

Christoph Hellwig Dec. 28, 2023, 7:51 a.m. UTC
Now that host-aware devices are always treated as conventional this case
can't happen.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/scsi/sd.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Comments

Hannes Reinecke Jan. 8, 2024, 8:48 a.m. UTC | #1
On 12/28/23 08:51, Christoph Hellwig wrote:
> Now that host-aware devices are always treated as conventional this case
> can't happen.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>   drivers/scsi/sd.c | 7 +++----
>   1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
> index 6bedd2d5298f6d..dace4aa8e3534d 100644
> --- a/drivers/scsi/sd.c
> +++ b/drivers/scsi/sd.c
> @@ -3149,12 +3149,11 @@ static void sd_read_block_characteristics(struct scsi_disk *sdkp)
>   		 * the device physical block size.
>   		 */
>   		blk_queue_zone_write_granularity(q, sdkp->physical_block_size);
> -	} else if (blk_queue_is_zoned(q)) {
> +	} else {
>   		/*
> -		 * Anything else.  This includes host-aware device that we treat
> -		 * as conventional.
> +		 * Host-aware devices are treated as conventional.
>   		 */
> -		disk_clear_zoned(sdkp->disk);
> +		WARN_ON_ONCE(blk_queue_is_zoned(q));
>   	}
>   #endif /* CONFIG_BLK_DEV_ZONED */
>   
Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
diff mbox series

Patch

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 6bedd2d5298f6d..dace4aa8e3534d 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -3149,12 +3149,11 @@  static void sd_read_block_characteristics(struct scsi_disk *sdkp)
 		 * the device physical block size.
 		 */
 		blk_queue_zone_write_granularity(q, sdkp->physical_block_size);
-	} else if (blk_queue_is_zoned(q)) {
+	} else {
 		/*
-		 * Anything else.  This includes host-aware device that we treat
-		 * as conventional.
+		 * Host-aware devices are treated as conventional.
 		 */
-		disk_clear_zoned(sdkp->disk);
+		WARN_ON_ONCE(blk_queue_is_zoned(q));
 	}
 #endif /* CONFIG_BLK_DEV_ZONED */