Message ID | 20180531084240.11104-1-damien.lemoal@wdc.com (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
On Thu, 2018-05-31 at 17:42 +0900, Damien Le Moal wrote: > If a drive with variable zone sizes or an invalid last zone size is > detected, the local variable this_zone_blocks is set to 0 and early > retrun from the function triggered, but this does not result in an > error return. The local variable zone_blocks must be set to 0 for an > error to be returned. > > Fixes: ccce20fc7968 ("scsi: sd_zbc: Avoid that resetting a zone fails sporadically") > Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com> > Cc: Bart Van Assche <bart.vanassche@wdc.com> > --- > drivers/scsi/sd_zbc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/scsi/sd_zbc.c b/drivers/scsi/sd_zbc.c > index 323e3dc4bc59..850c803a6b3d 100644 > --- a/drivers/scsi/sd_zbc.c > +++ b/drivers/scsi/sd_zbc.c > @@ -442,7 +442,7 @@ static s64 sd_zbc_check_zone_size(struct scsi_disk *sdkp) > } else if (this_zone_blocks != zone_blocks && > (block + this_zone_blocks < sdkp->capacity > || this_zone_blocks > zone_blocks)) { > - this_zone_blocks = 0; > + zone_blocks = 0; > goto out; > } > block += this_zone_blocks; Reviewed-by: Bart Van Assche <bart.vanassche@wdc.com>
Damien, > If a drive with variable zone sizes or an invalid last zone size is > detected, the local variable this_zone_blocks is set to 0 and early > retrun from the function triggered, but this does not result in an > error return. The local variable zone_blocks must be set to 0 for an > error to be returned. Applied to 4.18/scsi-fixes. Thank you!
diff --git a/drivers/scsi/sd_zbc.c b/drivers/scsi/sd_zbc.c index 323e3dc4bc59..850c803a6b3d 100644 --- a/drivers/scsi/sd_zbc.c +++ b/drivers/scsi/sd_zbc.c @@ -442,7 +442,7 @@ static s64 sd_zbc_check_zone_size(struct scsi_disk *sdkp) } else if (this_zone_blocks != zone_blocks && (block + this_zone_blocks < sdkp->capacity || this_zone_blocks > zone_blocks)) { - this_zone_blocks = 0; + zone_blocks = 0; goto out; } block += this_zone_blocks;
If a drive with variable zone sizes or an invalid last zone size is detected, the local variable this_zone_blocks is set to 0 and early retrun from the function triggered, but this does not result in an error return. The local variable zone_blocks must be set to 0 for an error to be returned. Fixes: ccce20fc7968 ("scsi: sd_zbc: Avoid that resetting a zone fails sporadically") Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com> Cc: Bart Van Assche <bart.vanassche@wdc.com> --- drivers/scsi/sd_zbc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)