mirror of
https://github.com/torvalds/linux.git
synced 2026-11-20 13:03:48 +00:00
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:
committed by
Jens Axboe
parent
fd932734f4
commit
3e756cc861
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user