diff options
author | Damien Le Moal <damien.lemoal@wdc.com> | 2019-12-20 16:58:22 +0900 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2020-01-02 21:53:31 -0500 |
commit | 19aaa4072327f467ab82db7d1f0055675e2a4cd4 (patch) | |
tree | 5add1a5d0f0f5eca381f32065b6b75501b7c368a /drivers/scsi/sd_zbc.c | |
parent | a9c4ae108610716140bdec56ae0bebbe1c5cbe49 (diff) | |
download | linux-19aaa4072327f467ab82db7d1f0055675e2a4cd4.tar.gz linux-19aaa4072327f467ab82db7d1f0055675e2a4cd4.tar.bz2 linux-19aaa4072327f467ab82db7d1f0055675e2a4cd4.zip |
scsi: sd_zbc: Simplify sd_zbc_check_zones()
Now that the block layer generic zone revalidation code in
blk_revalidate_disk_zones() checks for power of 2 zone size, there is no
need to do it in sd_zbc_check_zones(). Remove this check.
Link: https://lore.kernel.org/r/20191220075823.400072-2-damien.lemoal@wdc.com
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/sd_zbc.c')
-rw-r--r-- | drivers/scsi/sd_zbc.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/drivers/scsi/sd_zbc.c b/drivers/scsi/sd_zbc.c index e0bd4cf17230..aca6367ced06 100644 --- a/drivers/scsi/sd_zbc.c +++ b/drivers/scsi/sd_zbc.c @@ -325,14 +325,11 @@ static int sd_zbc_check_zoned_characteristics(struct scsi_disk *sdkp, } /** - * sd_zbc_check_zones - Check the device capacity and zone sizes + * sd_zbc_check_zones - Check the device capacity and zone size * @sdkp: Target disk * * Check that the device capacity as reported by READ CAPACITY matches the - * max_lba value (plus one)of the report zones command reply. Also check that - * all zones of the device have an equal size, only allowing the last zone of - * the disk to have a smaller size (runt zone). The zone size must also be a - * power of two. + * max_lba value (plus one)of the report zones command reply. * * Returns the zone size in number of blocks upon success or an error code * upon failure. @@ -366,14 +363,6 @@ static int sd_zbc_check_zones(struct scsi_disk *sdkp, unsigned char *buf, /* Parse REPORT ZONES header */ rec = buf + 64; zone_blocks = get_unaligned_be64(&rec[8]); - if (!zone_blocks || !is_power_of_2(zone_blocks)) { - if (sdkp->first_scan) - sd_printk(KERN_NOTICE, sdkp, - "Devices with non power of 2 zone " - "size are not supported\n"); - return -ENODEV; - } - if (logical_to_sectors(sdkp->device, zone_blocks) > UINT_MAX) { if (sdkp->first_scan) sd_printk(KERN_NOTICE, sdkp, |