1 From f13cff6c25bd8986627365346d123312ee7baa78 Mon Sep 17 00:00:00 2001
2 From: Damien Le Moal <damien.lemoal@wdc.com>
3 Date: Tue, 3 Jul 2018 15:23:58 +0900
4 Subject: scsi: sd_zbc: Fix variable type and bogus comment
6 From: Damien Le Moal <damien.lemoal@wdc.com>
8 commit f13cff6c25bd8986627365346d123312ee7baa78 upstream.
10 Fix the description of sd_zbc_check_zone_size() to correctly explain that
11 the returned value is a number of device blocks, not bytes. Additionally,
12 the 32 bits "ret" variable used in this function may truncate the 64 bits
13 zone_blocks variable value upon return. To fix this, change "ret" type to
16 Fixes: ccce20fc79 ("sd_zbc: Avoid that resetting a zone fails sporadically")
17 Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
18 Cc: Bart Van Assche <bart.vanassche@wdc.com>
20 Reviewed-by: Hannes Reinecke <hare@suse.com>
21 Reviewed-by: Bart Van Assche <bart.vanassche@wdc.com>
22 Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
23 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
26 drivers/scsi/sd_zbc.c | 5 +++--
27 1 file changed, 3 insertions(+), 2 deletions(-)
29 --- a/drivers/scsi/sd_zbc.c
30 +++ b/drivers/scsi/sd_zbc.c
31 @@ -401,7 +401,8 @@ static int sd_zbc_check_capacity(struct
32 * Check that all zones of the device are equal. The last zone can however
33 * be smaller. The zone size must also be a power of two number of LBAs.
35 - * Returns the zone size in bytes upon success or an error code upon failure.
36 + * Returns the zone size in number of blocks upon success or an error code
39 static s64 sd_zbc_check_zone_size(struct scsi_disk *sdkp)
41 @@ -411,7 +412,7 @@ static s64 sd_zbc_check_zone_size(struct
44 unsigned int list_length;