Skip to content

Commit e5aba91

Browse files
committed
erofs: fix ztailpacking for subpage compressed blocks
`pageofs_in` should be the compressed data offset of the page rather than of the block. Acked-by: Chao Yu <[email protected]> Reviewed-by: Yue Hu <[email protected]> Signed-off-by: Gao Xiang <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 8d2517a commit e5aba91

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/erofs/zdata.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,6 @@ static int z_erofs_register_pcluster(struct z_erofs_decompress_frontend *fe)
810810

811811
if (ztailpacking) {
812812
pcl->obj.index = 0; /* which indicates ztailpacking */
813-
pcl->pageofs_in = erofs_blkoff(fe->inode->i_sb, map->m_pa);
814813
} else {
815814
pcl->obj.index = erofs_blknr(sb, map->m_pa);
816815

@@ -887,6 +886,7 @@ static int z_erofs_pcluster_begin(struct z_erofs_decompress_frontend *fe)
887886
}
888887
get_page(map->buf.page);
889888
WRITE_ONCE(fe->pcl->compressed_bvecs[0].page, map->buf.page);
889+
fe->pcl->pageofs_in = map->m_pa & ~PAGE_MASK;
890890
fe->mode = Z_EROFS_PCLUSTER_FOLLOWED_NOINPLACE;
891891
}
892892
/* file-backed inplace I/O pages are traversed in reverse order */

0 commit comments

Comments
 (0)