Skip to contentSkip to conversation

erofs: fix up inplace decompression success rate

PATCH In review Gao Xiang 2 participants 2 messages Oct 14, 2022 – Oct 15, 2022 EROFS file system

lore
Share & tools
lore

Gao Xiang

author
#0 lore raw

PATCH 1/1 erofs: fix up inplace decompression success rate

Partial decompression should be checked after updating length. It's a new regression when introducing multi-reference pclusters.

Fixes 2bfab9c0edac ("erofs: record the longest decompressed size in this round")
---
 fs/erofs/zdata.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
fs/erofs/zdata.c +4 -5
index cce56dde135c..2417d7b73622 100644
@@ -812,15 +812,14 @@ static int z_erofs_do_read_page(struct z_erofs_decompress_frontend *fe,
 	++spiltted;
 	if (fe->pcl->pageofs_out != (map->m_la & ~PAGE_MASK))
 		fe->pcl->multibases = true;
-
-	if ((map->m_flags & EROFS_MAP_FULL_MAPPED) &&
-	    !(map->m_flags & EROFS_MAP_PARTIAL_REF) &&
-	    fe->pcl->length == map->m_llen)
-		fe->pcl->partial = false;
 	if (fe->pcl->length < offset + end - map->m_la) {
 		fe->pcl->length = offset + end - map->m_la;
 		fe->pcl->pageofs_out = map->m_la & ~PAGE_MASK;
 	}
+	if ((map->m_flags & EROFS_MAP_FULL_MAPPED) &&
+	    !(map->m_flags & EROFS_MAP_PARTIAL_REF) &&
+	    fe->pcl->length == map->m_llen)
+		fe->pcl->partial = false;
 next_part:
 	/* shorten the remaining extent to update progress */
 	map->m_llen = offset + cur - map->m_la;
Signature · 1 line
2.24.4
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Gao Xiang

Partial decompression should be checked after updating length. It's a new regression when introducing multi-reference pclusters.

Fixes 2bfab9c0edac ("erofs: record the longest decompressed size in this round")

Thanks,