scsi: sd_zbc: block: Respect bio vector limits for REPORT ZONES buffer
authorSteve Siwinski <ssiwinski@atto.com>
Thu, 8 May 2025 20:01:22 +0000 (16:01 -0400)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 13 May 2025 02:35:48 +0000 (22:35 -0400)
commite8007fad5457ea547ca63bb011fdb03213571c7e
tree6451889611f6dfdf97689c309db0a79913089182
parent0e9693b97a0eee1df7bae33aec207c975fbcbdb8
scsi: sd_zbc: block: Respect bio vector limits for REPORT ZONES buffer

The REPORT ZONES buffer size is currently limited by the HBA's maximum
segment count to ensure the buffer can be mapped. However, the block
layer further limits the number of iovec entries to 1024 when allocating
a bio.

To avoid allocation of buffers too large to be mapped, further restrict
the maximum buffer size to BIO_MAX_INLINE_VECS.

Replace the UIO_MAXIOV symbolic name with the more contextually
appropriate BIO_MAX_INLINE_VECS.

Fixes: b091ac616846 ("sd_zbc: Fix report zones buffer allocation")
Cc: stable@vger.kernel.org
Signed-off-by: Steve Siwinski <ssiwinski@atto.com>
Link: https://lore.kernel.org/r/20250508200122.243129-1-ssiwinski@atto.com
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
block/bio.c
drivers/scsi/sd_zbc.c
include/linux/bio.h