On Mon, Aug 31, 2026 at 09:39:50AM +0300, Christoph Hellwig wrote:
quoted hunk ↗ jump to hunk
Catch cases where upper layer bugs create larger I/Os than the
mempool would return even without dipping into the mempool.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
block/bio-integrity.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/block/bio-integrity.c b/block/bio-integrity.c
index b23e2434d80c..d3df726e0f08 100644
--- a/block/bio-integrity.c
+++ b/block/bio-integrity.c
@@ -72,6 +72,7 @@ void bio_integrity_alloc_buf(struct bio *bio, gfp_t gfp, bool zero_buffer)
unsigned int len = bio_integrity_bytes(bi, bio_sectors(bio));
void *buf;
+ WARN_ON_ONCE(len > BLK_INTEGRITY_MAX_SIZE);
Should it fail the bio after complaining, then?
--D
buf = kmalloc(len, gfp | __GFP_NOWARN | (zero_buffer ? __GFP_ZERO : 0));
if (unlikely(!buf)) {
struct page *page;
--
2.53.0