Skip to content

Commit 4a10903

Browse files
damien-lemoalmartinkpetersen
authored andcommitted
scsi: sd_zbc: Fix sd_zbc_read_zoned_characteristics()
The three values starting at byte 8 of the Zoned Block Device Characteristics VPD page B6h are 32 bits values, not 64bits. So use get_unaligned_be32() to retrieve the values and not get_unaligned_be64() Fixes: 89d9475 ("sd: Implement support for ZBC devices") Cc: <[email protected]> Signed-off-by: Damien Le Moal <[email protected]> Reviewed-by: Bart Van Assche <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent e8c77ec commit 4a10903

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/scsi/sd_zbc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -423,15 +423,15 @@ static int sd_zbc_read_zoned_characteristics(struct scsi_disk *sdkp,
423423
if (sdkp->device->type != TYPE_ZBC) {
424424
/* Host-aware */
425425
sdkp->urswrz = 1;
426-
sdkp->zones_optimal_open = get_unaligned_be64(&buf[8]);
427-
sdkp->zones_optimal_nonseq = get_unaligned_be64(&buf[12]);
426+
sdkp->zones_optimal_open = get_unaligned_be32(&buf[8]);
427+
sdkp->zones_optimal_nonseq = get_unaligned_be32(&buf[12]);
428428
sdkp->zones_max_open = 0;
429429
} else {
430430
/* Host-managed */
431431
sdkp->urswrz = buf[4] & 1;
432432
sdkp->zones_optimal_open = 0;
433433
sdkp->zones_optimal_nonseq = 0;
434-
sdkp->zones_max_open = get_unaligned_be64(&buf[16]);
434+
sdkp->zones_max_open = get_unaligned_be32(&buf[16]);
435435
}
436436

437437
return 0;

0 commit comments

Comments
 (0)