Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp287838rdf; Thu, 2 Nov 2023 23:58:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE0o1pd58EL1h/1Ez67zJNHlo7QBBl1CD5JLFUW32pVCmeNqjzgTNiRmG9yiFuO+IpaksJ0 X-Received: by 2002:a05:6a20:5485:b0:131:a21:9f96 with SMTP id i5-20020a056a20548500b001310a219f96mr29668015pzk.6.1698994696935; Thu, 02 Nov 2023 23:58:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698994696; cv=none; d=google.com; s=arc-20160816; b=xdQH5DxOi57GHcoMJLByOwwCuwqWe7Q/2OyzFOppe8FcbGzWhS6fBieCzVSWiqx8iG 8tEFiydVlEey4x0u/0re68LDhqk726xR2ojGkGiYvbQ5cL3XbhHx1QNpyBUixy5sAgQw beXziqOBb9hnwGjCydwQP+nc0+tP/8QxYqK4ZzDWvmts82Zt7V5exNsvVMaV/sfD5cYc Ymz8UsIXsPUgJn8bfbSgKKuLJAdaDwbHqCwG7CYr5xfYkuR4qO405B39iCgES6X/w3XM R99icbVLGL7vhEj7v9jpXlvyeR/D+39N+ywrmcLbJRvn0nN8RSqF3dZpeUPrSUduCk+G OGrQ== 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=qV2KYVqSghlbqtqI/ejpPww71wlzRV1QJ1EcNejIhSY=; fh=FsznnDxpmef1vC1z7PHIgrdOV6pY0Temw/oyToZsikg=; b=RJIezpxyLWRjphASfjRSxNTxGNHir1mxuQBoX1fDEWm8/7Dw8KAamGNthWnjnlHOvI hEY0M5PbCOG+Gm9OtDZ6zEgw6Nyw+hStKMvaffgLIR1AchjEMIWdo8iTyiH5EZ3zzF8j jDxuTBZXf56DzgpmTpYV83YypA1372JzmjQLBBKd6Hwg/mGbLj16IODvlix/aKIv99VI CbHMr8wuUrBpMWeEIeqH/j3O0UJgLzZeouBkf6xq/h9r30bw+3MZDILZEORrfijgNPtt QAmMn6g+Mv1RZF3oeCwDCQdGporLnedTx21Dy5F5KXQZP8bu2HTa3MwW0EPyymhlM++u N59A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id k14-20020a17090a3cce00b002774aec6805si1054189pjd.68.2023.11.02.23.58.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 23:58:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id C4F12830C304; Thu, 2 Nov 2023 23:58:15 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232693AbjKCG6P (ORCPT + 99 others); Fri, 3 Nov 2023 02:58:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232822AbjKCG6K (ORCPT ); Fri, 3 Nov 2023 02:58:10 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F32A7131 for ; Thu, 2 Nov 2023 23:58:07 -0700 (PDT) Received: from kwepemm000013.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4SMBQZ0jFRzVjpN; Fri, 3 Nov 2023 14:57:58 +0800 (CST) Received: from huawei.com (10.175.104.67) by kwepemm000013.china.huawei.com (7.193.23.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Fri, 3 Nov 2023 14:58:02 +0800 From: Zhihao Cheng To: , CC: , , Subject: [PATCH 5/5] ext4: Move ext4_check_bdev_write_error() into nojournal mode Date: Fri, 3 Nov 2023 22:52:50 +0800 Message-ID: <20231103145250.2995746-6-chengzhihao1@huawei.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231103145250.2995746-1-chengzhihao1@huawei.com> References: <20231103145250.2995746-1-chengzhihao1@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.104.67] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemm000013.china.huawei.com (7.193.23.81) X-CFilter-Loop: Reflected X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_06_12, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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-ext4@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 02 Nov 2023 23:58:15 -0700 (PDT) Since JBD2 takes care of all metadata writeback errors of fs dev, ext4_check_bdev_write_error() is useful only in nojournal mode. Move it into '!ext4_handle_valid(handle)' branch. Signed-off-by: Zhihao Cheng Suggested-by: Jan Kara --- fs/ext4/ext4_jbd2.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/ext4/ext4_jbd2.c b/fs/ext4/ext4_jbd2.c index d1a2e6624401..5d8055161acd 100644 --- a/fs/ext4/ext4_jbd2.c +++ b/fs/ext4/ext4_jbd2.c @@ -235,8 +235,6 @@ int __ext4_journal_get_write_access(const char *where, unsigned int line, might_sleep(); - ext4_check_bdev_write_error(sb); - if (ext4_handle_valid(handle)) { err = jbd2_journal_get_write_access(handle, bh); if (err) { @@ -244,7 +242,8 @@ int __ext4_journal_get_write_access(const char *where, unsigned int line, handle, err); return err; } - } + } else + ext4_check_bdev_write_error(sb); if (trigger_type == EXT4_JTR_NONE || !ext4_has_metadata_csum(sb)) return 0; BUG_ON(trigger_type >= EXT4_JOURNAL_TRIGGER_COUNT); -- 2.39.2