block: warn on too larger integrity allocations

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 <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
Christoph Hellwig
2026-09-14 07:42:07 -06:00
committed by Jens Axboe
parent fd932734f4
commit 3e756cc861
+1
View File
@@ -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);
buf = kmalloc(len, gfp | __GFP_NOWARN | (zero_buffer ? __GFP_ZERO : 0));
if (unlikely(!buf)) {
struct page *page;