summaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorSteve Siwinski <ssiwinski@atto.com>2025-05-08 16:01:22 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-05-22 14:29:49 +0200
commitbffc3038a28b9be7caffdaec53b08b15fa0d8b06 (patch)
tree9a0062fd5d666db2bb91e63d671d01d6e785bfac /block
parentc450f648d0fc3fa01ebf16de70757f54b359735d (diff)
downloadlinux-bffc3038a28b9be7caffdaec53b08b15fa0d8b06.tar.gz
linux-bffc3038a28b9be7caffdaec53b08b15fa0d8b06.tar.bz2
linux-bffc3038a28b9be7caffdaec53b08b15fa0d8b06.zip
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>
Diffstat (limited to 'block')
-rw-r--r--block/bio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/bio.c b/block/bio.c
index 43d4ae26f475..20c74696bf23 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -611,7 +611,7 @@ struct bio *bio_kmalloc(unsigned short nr_vecs, gfp_t gfp_mask)
{
struct bio *bio;
- if (nr_vecs > UIO_MAXIOV)
+ if (nr_vecs > BIO_MAX_INLINE_VECS)
return NULL;
return kmalloc(struct_size(bio, bi_inline_vecs, nr_vecs), gfp_mask);
}