From nobody Sat Dec 27 22:53:35 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73871C4332F for ; Thu, 14 Dec 2023 16:13:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229953AbjLNQNm (ORCPT ); Thu, 14 Dec 2023 11:13:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229563AbjLNQNk (ORCPT ); Thu, 14 Dec 2023 11:13:40 -0500 Received: from out30-130.freemail.mail.aliyun.com (out30-130.freemail.mail.aliyun.com [115.124.30.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 537AD10E for ; Thu, 14 Dec 2023 08:13:46 -0800 (PST) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R921e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045176;MF=hsiangkao@linux.alibaba.com;NM=1;PH=DS;RN=4;SR=0;TI=SMTPD_---0VyUqVoN_1702570418; Received: from e69b19392.et15sqa.tbsite.net(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0VyUqVoN_1702570418) by smtp.aliyun-inc.com; Fri, 15 Dec 2023 00:13:44 +0800 From: Gao Xiang To: linux-erofs@lists.ozlabs.org, Chao Yu Cc: LKML , Gao Xiang Subject: [PATCH] erofs: fix ztailpacking for subpage compressed blocks Date: Fri, 15 Dec 2023 00:13:37 +0800 Message-Id: <20231214161337.753049-1-hsiangkao@linux.alibaba.com> X-Mailer: git-send-email 2.39.3 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" `pageofs_in` should be the compressed data offset of the page rather than of the block. Signed-off-by: Gao Xiang Acked-by: Chao Yu Reviewed-by: Yue Hu --- fs/erofs/zdata.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c index a2c3e87d2f81..8264936b8612 100644 --- a/fs/erofs/zdata.c +++ b/fs/erofs/zdata.c @@ -812,7 +812,6 @@ static int z_erofs_register_pcluster(struct z_erofs_dec= ompress_frontend *fe) =20 if (ztailpacking) { pcl->obj.index =3D 0; /* which indicates ztailpacking */ - pcl->pageofs_in =3D erofs_blkoff(fe->inode->i_sb, map->m_pa); } else { pcl->obj.index =3D erofs_blknr(sb, map->m_pa); =20 @@ -889,6 +888,7 @@ static int z_erofs_pcluster_begin(struct z_erofs_decomp= ress_frontend *fe) } get_page(map->buf.page); WRITE_ONCE(fe->pcl->compressed_bvecs[0].page, map->buf.page); + fe->pcl->pageofs_in =3D map->m_pa & ~PAGE_MASK; fe->mode =3D Z_EROFS_PCLUSTER_FOLLOWED_NOINPLACE; } /* file-backed inplace I/O pages are traversed in reverse order */ --=20 2.39.3