Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2129048iog; Sun, 19 Jun 2022 08:12:56 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tsQuZkRoBJuN7TSpn8pVbhpNTopXw4BXK5BGuj4Rqu9RFrkzBoGRxeF0P5MXcbL6bDpJSl X-Received: by 2002:a17:902:ecc9:b0:16a:edb:5bf7 with SMTP id a9-20020a170902ecc900b0016a0edb5bf7mr9148950plh.90.1655651576258; Sun, 19 Jun 2022 08:12:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655651576; cv=none; d=google.com; s=arc-20160816; b=z9YjhpkKp/uWP7adb33c2gO06UqbpXiKekpHEW1crT3bH0AyxfkF5s70TzOkB9Ns2C 5MHFN7XKaX0G2YhTyI+UPQ0/f0CYvzCuv3LkFZ6qeKRy/pF7dFeDPFdC70DRzYlbYDf6 CcJMw7JQHJrXI393iFFAg01cq329NOacjL4WziE2ij0nVPHQbaxzHCOafmYZY/cQeuQ5 PSdk6K1dvUJyOzp0GmwgCdQVubLHRhISOPM74j8k3fyrD/kPU2DibLY1BmwijRPjm76y y2aqet7DW5GK/+tToCp2F1iCSOar+cbgrT0tY9I7hqRp5u79KmnSk+5u3Zl7zCiQIdFg jucQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=ZPIcxFRKHUmyyAKUZNbD2D9VaQNEXGyjkEoNSuDocNU=; b=TnSaGwIsYulQgIXFg2XbTooYLZAKjqwNwIIziqZMKubQlW/YbVD1kW260QMsJlCGpC dBbb8AmnZ2bV1jZr2C4hB9M1EIlNWbc1hRKKIgXBwjAAUINGvtRV/tQqcnXj9lAJBDV/ 55H+wAou3GF9NiieGQANqf43fD1nugnzpxIufV28Tt3Qpzbqt2V3PYzEGWUSO7AsgJ9v Y+WT0Dg4BBf19hDNL+cqq2i9YCt6tS9AfZfaq4q7xzrQC48RTHpIR/gvrPykN2DIXApk 5/w8SAWRJG+cbUimupeYlPNPr+i59Kj9mW137CGK/fEdY0ZfeDO7frVA4XiYB8+Nt/TW iPJQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bf14-20020a056a000d8e00b00518467340b6si10592841pfb.153.2022.06.19.08.12.41; Sun, 19 Jun 2022 08:12:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230310AbiFSPKI (ORCPT + 99 others); Sun, 19 Jun 2022 11:10:08 -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: 8bit X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Convert the last hardcoded PAGE_SIZEs of uncompressed cases. Signed-off-by: Gao Xiang --- 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_context *ctx) nameoff = le16_to_cpu(de->nameoff); if (nameoff < sizeof(struct erofs_dirent) || - nameoff >= PAGE_SIZE) { + nameoff >= 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_context *ctx) } maxsize = min_t(unsigned int, - dirsize - ctx->pos + ofs, PAGE_SIZE); + dirsize - ctx->pos + ofs, EROFS_BLKSIZ); /* search dirents at the arbitrary position */ if (initial) { -- 2.24.4