From nobody Sun Apr 26 10:07:06 2026 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 C9929C43334 for ; Sun, 19 Jun 2022 15:10:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230425AbiFSPKK (ORCPT ); Sun, 19 Jun 2022 11:10:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229909AbiFSPKG (ORCPT ); Sun, 19 Jun 2022 11:10:06 -0400 Received: from out30-54.freemail.mail.aliyun.com (out30-54.freemail.mail.aliyun.com [115.124.30.54]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72D9B260C for ; Sun, 19 Jun 2022 08:10:01 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R161e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046049;MF=hsiangkao@linux.alibaba.com;NM=1;PH=DS;RN=4;SR=0;TI=SMTPD_---0VGmrGPz_1655651382; Received: from e18g06460.et15sqa.tbsite.net(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0VGmrGPz_1655651382) by smtp.aliyun-inc.com; Sun, 19 Jun 2022 23:09:57 +0800 From: Gao Xiang To: Chao Yu , linux-erofs@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org, Gao Xiang Subject: [PATCH] erofs: get rid of the leftover PAGE_SIZE in dir.c Date: Sun, 19 Jun 2022 23:09:40 +0800 Message-Id: <20220619150940.121005-1-hsiangkao@linux.alibaba.com> X-Mailer: git-send-email 2.24.4 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" Convert the last hardcoded PAGE_SIZEs of uncompressed cases. Signed-off-by: Gao Xiang Reviewed-by: Jeffle Xu --- fs/erofs/dir.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/erofs/dir.c b/fs/erofs/dir.c index 18e59821c597..723f5223a4fa 100644 --- a/fs/erofs/dir.c +++ b/fs/erofs/dir.c @@ -90,7 +90,7 @@ static int erofs_readdir(struct file *f, struct dir_conte= xt *ctx) =20 nameoff =3D le16_to_cpu(de->nameoff); if (nameoff < sizeof(struct erofs_dirent) || - nameoff >=3D PAGE_SIZE) { + nameoff >=3D EROFS_BLKSIZ) { erofs_err(dir->i_sb, "invalid de[0].nameoff %u @ nid %llu", nameoff, EROFS_I(dir)->nid); @@ -99,7 +99,7 @@ static int erofs_readdir(struct file *f, struct dir_conte= xt *ctx) } =20 maxsize =3D min_t(unsigned int, - dirsize - ctx->pos + ofs, PAGE_SIZE); + dirsize - ctx->pos + ofs, EROFS_BLKSIZ); =20 /* search dirents at the arbitrary position */ if (initial) { --=20 2.24.4