Skip to content

Commit e793327

Browse files
committed
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: 2bfab9c ("erofs: record the longest decompressed size in this round") Reviewed-by: Chao Yu <[email protected]> Signed-off-by: Gao Xiang <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 63bbb85 commit e793327

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

fs/erofs/zdata.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -813,15 +813,14 @@ static int z_erofs_do_read_page(struct z_erofs_decompress_frontend *fe,
813813
++spiltted;
814814
if (fe->pcl->pageofs_out != (map->m_la & ~PAGE_MASK))
815815
fe->pcl->multibases = true;
816-
817-
if ((map->m_flags & EROFS_MAP_FULL_MAPPED) &&
818-
!(map->m_flags & EROFS_MAP_PARTIAL_REF) &&
819-
fe->pcl->length == map->m_llen)
820-
fe->pcl->partial = false;
821816
if (fe->pcl->length < offset + end - map->m_la) {
822817
fe->pcl->length = offset + end - map->m_la;
823818
fe->pcl->pageofs_out = map->m_la & ~PAGE_MASK;
824819
}
820+
if ((map->m_flags & EROFS_MAP_FULL_MAPPED) &&
821+
!(map->m_flags & EROFS_MAP_PARTIAL_REF) &&
822+
fe->pcl->length == map->m_llen)
823+
fe->pcl->partial = false;
825824
next_part:
826825
/* shorten the remaining extent to update progress */
827826
map->m_llen = offset + cur - map->m_la;

0 commit comments

Comments
 (0)