From patchwork Fri Feb 10 03:20:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ye Bin X-Patchwork-Id: 55202 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp721374wrn; Thu, 9 Feb 2023 19:10:28 -0800 (PST) X-Google-Smtp-Source: AK7set+Umuy8rmOVfTw5pLoWeRETJbPeV5uoSSlPeFqs9+/RG4PeteIHChwXj5M62i99OV1hpVh2 X-Received: by 2002:a17:906:3812:b0:839:74cf:7c4f with SMTP id v18-20020a170906381200b0083974cf7c4fmr13427176ejc.8.1675998628610; Thu, 09 Feb 2023 19:10:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675998628; cv=none; d=google.com; s=arc-20160816; b=o/zetkxzcbpR5Ak7V4/ybCkbxQRRzqGoFydX7izJ7ovsOYnPvWNUlq9xtWJX1BCOsQ lrFrJgFcOYaZMPwKgN8cwFcmjyT6Ot9w924D1+rtjexaDGW8pvfMQj/EKahIoAXAvQFM 2SRuyRngy2HPvHqhk0ITAMHmyar+2OE2G2+d64G01XfG91hvUZHwqoMXbcV5Q1OfgBLX G33CIpeA27DAI2jJXhOadTKP/pPFDdlNaxnQgXLdX+z61yM85rDZbAxCQvrUAnjfYCKx Qk5CPQXBOfrTgm5Hts3/cNQzMgtvNsUTX30T/n3g1Lef6WZJgDDHaJEh8A5bC9T7yoO7 xYMg== 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=qYt4o5icjkSSfK2YqcJ/2bmkjV5m71mGT/zCDkgmpoA=; b=Oyl1b5c/3zTnTjKQl5c0TkilqyAwY0ZCYq2CaUyZ3SK66nn0Jlw2yy2rOckdbE9oFy jKRPvYxVTAeOsNqXBO1zlKYgtbU3pxKj8txRLNAENZl6PV5a6bW+OX249jkmQvPWCE5c QRTxweDweqAyC7Okl7V2QUDSIxyFsIX8JSz/i+aTX2g+mug2dLjS0GhEvOIK/5SxkqWl HCF9kT1JCwcf7hoUNq8rymTlbnQvBt/jX3bNlDUmHVdbbio3HqzBRNf2gb7COBgurQLr q+C5Tfo575nOFpcLYNgk3F9VlSJDZ2S+UQbz2JvOEp1/q7JbtVdGdulsdwzNyKCGz0AG lySw== 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 um32-20020a170907cb2000b008aac51f31desi4645488ejc.269.2023.02.09.19.10.04; Thu, 09 Feb 2023 19:10:28 -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 S231161AbjBJC5W (ORCPT + 99 others); Thu, 9 Feb 2023 21:57:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230413AbjBJC5G (ORCPT ); Thu, 9 Feb 2023 21:57:06 -0500 Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0DC28663CD; Thu, 9 Feb 2023 18:57:06 -0800 (PST) Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4PCdgJ2fhPz4f3jM0; Fri, 10 Feb 2023 10:57:00 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.127.227]) by APP3 (Coremail) with SMTP id _Ch0CgCHgR96suVjIkgqDA--.35208S10; Fri, 10 Feb 2023 10:57:02 +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 v2 6/6] ext4: make sure fs error flag setted before clear journal error Date: Fri, 10 Feb 2023 11:20:44 +0800 Message-Id: <20230210032044.146115-7-yebin@huaweicloud.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230210032044.146115-1-yebin@huaweicloud.com> References: <20230210032044.146115-1-yebin@huaweicloud.com> MIME-Version: 1.0 X-CM-TRANSID: _Ch0CgCHgR96suVjIkgqDA--.35208S10 X-Coremail-Antispam: 1UD129KBjvdXoWrtryDXF13GrW7XryxXryrZwb_yoWkXwbEq3 yxAan5Wrs3Ar1xKa18Can8Ww1vvws2vFnYqasayF15uryDXa4kCa4kWryfurn8uFWrKrZ8 JF18ZF1fGrWkZjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbVAYFVCjjxCrM7AC8VAFwI0_Wr0E3s1l1xkIjI8I6I8E6xAIw20E Y4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l82xGYIkIc2x26280x7IE14v26r126s 0DM28IrcIa0xkI8VCY1x0267AKxVW5JVCq3wA2ocxC64kIII0Yj41l84x0c7CEw4AK67xG Y2AK021l84ACjcxK6xIIjxv20xvE14v26w1j6s0DM28EF7xvwVC0I7IYx2IY6xkF7I0E14 v26r4UJVWxJr1l84ACjcxK6I8E87Iv67AKxVW0oVCq3wA2z4x0Y4vEx4A2jsIEc7CjxVAF wI0_GcCE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2j2 WlYx0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26r1j6r4UMcvjeVCFs4IE7xkE bVWUJVW8JwACjcxG0xvY0x0EwIxGrwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbV WUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF 67kF1VAFwI0_JF0_Jw1lIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUCVW8JwCI42 IY6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr1lIxAIcVCF04k26cxKx2IYs7xG6r1j6r1xMIIF 0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxh VjvjDU0xZFpf9x07UZo7tUUUUU= X-CM-SenderInfo: p1hex046kxt4xhlfz01xgou0bp/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,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?1757411938195493266?= X-GMAIL-MSGID: =?utf-8?q?1757411938195493266?= 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 d86ee5af2db9..b458af1cbf5c 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -6143,11 +6143,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);