From patchwork Wed Feb 1 11:46:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ye Bin X-Patchwork-Id: 51305 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp219191wrn; Wed, 1 Feb 2023 03:28:24 -0800 (PST) X-Google-Smtp-Source: AK7set+psuJrV21SIa4lExZveJ7zER2Cq6lFQ3etSzwun0ooQGQAY4WC0v30ZE17I3xwf2rU6x1B X-Received: by 2002:a17:902:f791:b0:198:adc4:2296 with SMTP id q17-20020a170902f79100b00198adc42296mr1157489pln.17.1675250904073; Wed, 01 Feb 2023 03:28:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675250904; cv=none; d=google.com; s=arc-20160816; b=HO4yj2FkG6YFcVxK1CZHo2zoZ8kSKJE1rrYmnCA3M9/Swax7KXELor7xLnUJ+DrltJ +/TIRc+7gdukrPkkoEWejes7WJy6bcEk/lDB4AJZZiFxNpl1E0Rpt9lYsRQRn7/FHl3Q wYDKgjqul/ApDFwuIOpwkWF84h3UEQXoNBI1dSOTCvu+15+bsia6DN6J5h8W1YPxFUik NH8HNwH+ToM21G3xOGK9Pa1d1gQVIkKxU90Y/k68hJ8maDZ8x9dKwW9d354crnRe4raZ g72kWyiIBqHbwdRUinIGYZqvXjyE6fvQJTEr5iemqmXgBxGJepRePDfZRHEaer1iwww+ durA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=24A4JA8Op1esYjaW/MAfPOWKZRMA6mufzV9u8OLwXoo=; b=Ln3ow11JVujvV1o1H5L8s/7+cwRVDgut8YNE/kiOT+m4J5sSqvvrsmz+qCU3TL91ai z/n4Ou3o2kZHSut0ZwlwD+5DN4Xl7KEwrujXxcteZqyr4gkgsA2XXfIJ4XS7pC8Yogfa 3Fr/Wh0nh4Ujd6HteMK0z5MBczm1XZyp+dMRUEflhjOBl7s+ZjFI+xsOZphdTFoShv/U Jv8JxsN07/RatcaG1GJS3SzHCdFZh3tYmE+Jopl2Kx/q3ZKTTXLBwehB2JkstZzYm9VQ gH6mtvPE1WkLTCaNyv9i1UpX5/ybySvbVKxCgHaS/Ysw6BbVU4+lgCanVt9qxdoGstta djTA== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x185-20020a6386c2000000b0047730e1a823si19195178pgd.858.2023.02.01.03.28.11; Wed, 01 Feb 2023 03:28:24 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232043AbjBALXN (ORCPT + 99 others); Wed, 1 Feb 2023 06:23:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231420AbjBALXB (ORCPT ); Wed, 1 Feb 2023 06:23:01 -0500 Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9CF44EE8; Wed, 1 Feb 2023 03:22:59 -0800 (PST) Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4P6KKB6w1vz4f3nTZ; Wed, 1 Feb 2023 19:22:54 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.127.227]) by APP3 (Coremail) with SMTP id _Ch0CgDn4R+NS9pj_j45Cg--.57546S9; Wed, 01 Feb 2023 19:22:57 +0800 (CST) From: Ye Bin To: tytso@mit.edu, adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org Cc: linux-kernel@vger.kernel.org, jack@suse.cz, Ye Bin Subject: [PATCH 5/5] ext4: make sure fs error flag setted before clear journal error Date: Wed, 1 Feb 2023 19:46:51 +0800 Message-Id: <20230201114651.4090446-6-yebin@huaweicloud.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230201114651.4090446-1-yebin@huaweicloud.com> References: <20230201114651.4090446-1-yebin@huaweicloud.com> MIME-Version: 1.0 X-CM-TRANSID: _Ch0CgDn4R+NS9pj_j45Cg--.57546S9 X-Coremail-Antispam: 1UD129KBjvdXoWrtryDXF13GrW7XryxXryrZwb_yoWkXwbEq3 yxZan5Wrs3Ar1xK3WrCan8WwnYvws2vrnYqasayF15uryDXa4kCa4kWryfurn8urWrKrZ8 JF18ZFn7KFWkZjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbVAYFVCjjxCrM7AC8VAFwI0_Wr0E3s1l1xkIjI8I6I8E6xAIw20E Y4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l82xGYIkIc2x26280x7IE14v26r126s 0DM28IrcIa0xkI8VCY1x0267AKxVW5JVCq3wA2ocxC64kIII0Yj41l84x0c7CEw4AK67xG Y2AK021l84ACjcxK6xIIjxv20xvE14v26w1j6s0DM28EF7xvwVC0I7IYx2IY6xkF7I0E14 v26r4UJVWxJr1l84ACjcxK6I8E87Iv67AKxVW0oVCq3wA2z4x0Y4vEx4A2jsIEc7CjxVAF wI0_GcCE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2j2 WlYx0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26r1j6r4UMcvjeVCFs4IE7xkE bVWUJVW8JwACjcxG0xvY0x0EwIxGrwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbV WUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF 67kF1VAFwI0_JF0_Jw1lIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUCVW8JwCI42 IY6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr1lIxAIcVCF04k26cxKx2IYs7xG6r1j6r1xMIIF 0xvEx4A2jsIE14v26r4j6F4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxh VjvjDU0xZFpf9x07UZo7tUUUUU= X-CM-SenderInfo: p1hex046kxt4xhlfz01xgou0bp/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,KHOP_HELO_FCRDNS, SPF_HELO_NONE,SPF_NONE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756627891819202158?= X-GMAIL-MSGID: =?utf-8?q?1756627891819202158?= From: Ye Bin Now, jounral error number maybe cleared even though ext4_commit_super() failed. This may lead to error flag miss, then fsck will miss to check file system deeply. Signed-off-by: Ye Bin --- fs/ext4/super.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index ab136d08d93d..c36cc9708258 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -6146,11 +6146,13 @@ static int ext4_clear_journal_err(struct super_block *sb, errstr = ext4_decode_error(sb, j_errno, nbuf); ext4_warning(sb, "Filesystem error recorded " "from previous mount: %s", errstr); - ext4_warning(sb, "Marking fs in need of filesystem check."); EXT4_SB(sb)->s_mount_state |= EXT4_ERROR_FS; es->s_state |= cpu_to_le16(EXT4_ERROR_FS); - ext4_commit_super(sb); + j_errno = ext4_commit_super(sb); + if (j_errno) + return j_errno; + ext4_warning(sb, "Marked fs in need of filesystem check."); jbd2_journal_clear_err(journal); jbd2_journal_update_sb_errno(journal);