Message ID | 20200822173000.1Xnt4z59r%akpm@linux-foundation.org |
---|---|
State | New |
Headers | show |
Series | [merged] squashfs-avoid-bio_alloc-failure-with-1mbyte-blocks.patch removed from -mm tree | expand |
--- a/fs/squashfs/block.c~squashfs-avoid-bio_alloc-failure-with-1mbyte-blocks +++ a/fs/squashfs/block.c @@ -87,7 +87,11 @@ static int squashfs_bio_read(struct supe int error, i; struct bio *bio; - bio = bio_alloc(GFP_NOIO, page_count); + if (page_count <= BIO_MAX_PAGES) + bio = bio_alloc(GFP_NOIO, page_count); + else + bio = bio_kmalloc(GFP_NOIO, page_count); + if (!bio) return -ENOMEM;