Skip to contentSkip to conversation

squashfs-avoid-bio_alloc-failure-with-1mbyte-blocks.patch removed from -mm tree

merged [email protected] 1 participant 1 message Aug 22, 2020 Stable branch

lore
Share & tools
lore

[email protected]

author tree notice Applied
#0 lore raw

The patch titled
Subject: squashfs: avoid bio_alloc() failure with 1Mbyte blocks
has been removed from the -mm tree. Its filename was
squashfs-avoid-bio_alloc-failure-with-1mbyte-blocks.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Phillip Lougher <[email protected]>
Subject: squashfs: avoid bio_alloc() failure with 1Mbyte blocks

This is a regression introduced by the patch "migrate from ll_rw_block usage to BIO".

Bio_alloc() is limited to 256 pages (1 Mbyte). This can cause a failure when reading 1 Mbyte block filesystems. The problem is a datablock can be fully (or almost uncompressed), requiring 256 pages, but, because blocks are not aligned to page boundaries, it may require 257 pages to read.

Bio_kmalloc() can handle 1024 pages, and so use this for the edge condition.

Fixes 93e72b3c612a ("squashfs: migrate from ll_rw_block usage to BIO")
Cc Philippe Liard <[email protected]>
Cc Christoph Hellwig <[email protected]>
Cc Adrien Schildknecht <[email protected]>
Cc Daniel Rosenberg <[email protected]>

---

 fs/squashfs/block.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
fs/squashfs/block.c renamed from fs/squashfs/block.c~squashfs-avoid-bio_alloc-failure-with-1mbyte-blocks +5 -1
@@ -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;
 

_

Patches currently in -mm which might be from [email protected] are