Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3611165rdg; Tue, 17 Oct 2023 23:53:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHNnvaNKas1vXGFOhf5S3ZDfIO8aVr/RlOWgDJrPwxqoy07568utnFBbadl2QFoNB3EWuqB X-Received: by 2002:a05:6359:100e:b0:143:97c6:1e3a with SMTP id ib14-20020a056359100e00b0014397c61e3amr4497345rwb.9.1697611982193; Tue, 17 Oct 2023 23:53:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697611982; cv=none; d=google.com; s=arc-20160816; b=YgLwco8cHpcMSuzY2SQ+AKUYwzrvvCpyakhhONzzzA9C+XoCGo/tGJtqRYnLLHxEnW otFPhbhrbdrcM5a0nUP6M+nT49+/gKQTyNe4Zq7tOQhiyjQGqCY//O9W9N0X4wV5S1GU Dop2P2n1vE0gOE0s5/lalW/5YlJYdt6k/VKAsh7bSs+mXNuGKCQ3w6oUpALw3uvAVQej 5JE0CDznWH7S93LCmDUVlTCYCRHGpKiKhTs0Od/nSOMLZXdG8qJ1/jcMwX8Gtj7/R/Ax d916tf4IbOg1+vZ/SrpLhjq5gl0PHS41RY4Pr/KI/Qf1akHmoh/Dm0/l1+DzT/snpsIP NbGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=iYzQhZWJn/nbGVXJffvQm1RZ6jrHzfVteFolX83VpOQ=; fh=jjDTLTkAaPK3cTutO2P9ZECZUYkGOS1dcBtirQV26To=; b=ZMOwvzP4faO/D2mwBuL26yi/Ft0poeH3Y+gOPcjNXXsaxWlq4a7bUYu4IkhSIeV9q9 ufm/AHo5wjkWL/bT+zVQ2b/ci12JI6M0CfehdSCs4Xx0YuZT2sj+2j0CsIb8poTEh+De lxH0fIEwis1/XU0SPlNogNpxDUZZopvNGGNrke8BJAikPDeTILwNH03BavvHXtdTGAFr difFmiepW8b1kTpEHfGmVF44J5LazBu2Z1Cgb5jBCBbjVmvxMWtGEQSf1YM+iQlQ7U25 uzvjh5C8dZosQWTBfSt4PqunYoxAiD7BYqc+ljRgxEPvNdWcBL1GTskGhqvAEKQuZeQP M/vQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id m22-20020a056a00081600b006be7d402d8csi2254388pfk.6.2023.10.17.23.53.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 23:53:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id E9FA7801BCC6; Tue, 17 Oct 2023 23:52:59 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229728AbjJRGww (ORCPT + 99 others); Wed, 18 Oct 2023 02:52:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229676AbjJRGwv (ORCPT ); Wed, 18 Oct 2023 02:52:51 -0400 Received: from SHSQR01.spreadtrum.com (mx1.unisoc.com [222.66.158.135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7496B0 for ; Tue, 17 Oct 2023 23:52:48 -0700 (PDT) Received: from dlp.unisoc.com ([10.29.3.86]) by SHSQR01.spreadtrum.com with ESMTP id 39I6q22d003506; Wed, 18 Oct 2023 14:52:02 +0800 (+08) (envelope-from Zhiguo.Niu@unisoc.com) Received: from SHDLP.spreadtrum.com (bjmbx01.spreadtrum.com [10.0.64.7]) by dlp.unisoc.com (SkyGuard) with ESMTPS id 4S9LyD6mfQz2KFmlh; Wed, 18 Oct 2023 14:47:48 +0800 (CST) Received: from bj08434pcu.spreadtrum.com (10.0.73.87) by BJMBX01.spreadtrum.com (10.0.64.7) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Wed, 18 Oct 2023 14:51:59 +0800 From: Zhiguo Niu To: , CC: , , , Subject: [PATCH] f2fs: fix error handling of __get_node_page Date: Wed, 18 Oct 2023 14:51:02 +0800 Message-ID: <1697611862-25239-1-git-send-email-zhiguo.niu@unisoc.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.0.73.87] X-ClientProxiedBy: SHCAS03.spreadtrum.com (10.0.1.207) To BJMBX01.spreadtrum.com (10.0.64.7) X-MAIL: SHSQR01.spreadtrum.com 39I6q22d003506 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Tue, 17 Oct 2023 23:53:00 -0700 (PDT) Use f2fs_handle_error to record inconsistent node block error and return -EFSCORRUPTED instead of -EINVAL. Signed-off-by: Zhiguo Niu --- fs/f2fs/node.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index 248764b..ed963c56 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -1467,7 +1467,8 @@ static struct page *__get_node_page(struct f2fs_sb_info *sbi, pgoff_t nid, ofs_of_node(page), cpver_of_node(page), next_blkaddr_of_node(page)); set_sbi_flag(sbi, SBI_NEED_FSCK); - err = -EINVAL; + f2fs_handle_error(sbi, ERROR_INCONSISTENT_FOOTER); + err = -EFSCORRUPTED; out_err: ClearPageUptodate(page); out_put_err: -- 1.9.1