aboutsummaryrefslogtreecommitdiff
path: root/scripts/gdb/linux/utils.py
diff options
context:
space:
mode:
authorNaohiro Aota <[email protected]>2021-09-06 23:06:42 +0900
committerMartin K. Petersen <[email protected]>2021-09-13 22:15:45 -0400
commit7215e909814fed7cda33c954943a4050d8348204 (patch)
tree68fed7108ab9ca1e4670f76a3643553081186b3d /scripts/gdb/linux/utils.py
parent265dfe8ebbabae7959060bd1c3f75c2473b697ed (diff)
scsi: sd_zbc: Ensure buffer size is aligned to SECTOR_SIZE
Reporting zones on a SCSI device sometimes fail with the following error: [76248.516390] ata16.00: invalid transfer count 131328 [76248.523618] sd 15:0:0:0: [sda] REPORT ZONES start lba 536870912 failed The error (from drivers/ata/libata-scsi.c:ata_scsi_zbc_in_xlat()) indicates that buffer size is not aligned to SECTOR_SIZE. This happens when the __vmalloc() failed. Consider we are reporting 4096 zones, then we will have "bufsize = roundup((4096 + 1) * 64, SECTOR_SIZE)" = (513 * 512) = 262656. Then, __vmalloc() failure halves the bufsize to 131328, which is no longer aligned to SECTOR_SIZE. Use rounddown() to ensure the size is always aligned to SECTOR_SIZE and fix the comment as well. Link: https://lore.kernel.org/r/[email protected] Fixes: 23a50861adda ("scsi: sd_zbc: Cleanup sd_zbc_alloc_report_buffer()") Cc: [email protected] # 5.5+ Reviewed-by: Johannes Thumshirn <[email protected]> Reviewed-by: Damien Le Moal <[email protected]> Reviewed-by: Himanshu Madhani <[email protected]> Signed-off-by: Naohiro Aota <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
Diffstat (limited to 'scripts/gdb/linux/utils.py')
0 files changed, 0 insertions, 0 deletions