]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 22 May 2025 12:12:22 +0000 (14:12 +0200)
commitc682a193447a0f2743b3192a9dfe1272dcc98f31
tree79bd06811e507dc529176efa165e0448e68e593f
parenta1546ec7e049888db0cb708345313fee7e6971a8
scsi: sd_zbc: block: Respect bio vector limits for REPORT ZONES buffer

commit e8007fad5457ea547ca63bb011fdb03213571c7e upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
block/bio.c
drivers/scsi/sd_zbc.c
include/linux/bio.h