From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4F19AC46467 for ; Wed, 4 Jan 2023 14:56:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230073AbjADO43 (ORCPT ); Wed, 4 Jan 2023 09:56:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239168AbjADO4C (ORCPT ); Wed, 4 Jan 2023 09:56:02 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C0DA1EEC1 for ; Wed, 4 Jan 2023 06:56:01 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 10D86615CD for ; Wed, 4 Jan 2023 14:56:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1A464C433D2; Wed, 4 Jan 2023 14:55:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1672844160; bh=k7k6qpd7NKtxbkFvO+Rpios2rEbN+R3JtpsfoLJyghs=; h=Subject:To:Cc:From:Date:From; b=b9w57A0aSsEZf4hcy7okJO7gynC7H4MoTjgaLCKs862NHklUP29udWINtPCSPnphb h6+QJbp7vgBoDY7ambgbYbf61G1EUEWPNa09nmfhGVt/7S1ty0p2NS5xH4m0m08Fre hapl4K+NXiLupTKsnzt53v3Y9NTy59kWEte7r8+E= Subject: FAILED: patch "[PATCH] ext4: correct inconsistent error msg in nojournal mode" failed to apply to 6.0-stable tree To: libaokun1@huawei.com, jack@suse.cz, tytso@mit.edu Cc: From: Date: Wed, 04 Jan 2023 15:54:38 +0100 Message-ID: <167284407879253@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below does not apply to the 6.0-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . Possible dependencies: 89481b5fa8c0 ("ext4: correct inconsistent error msg in nojournal mode") 43bd6f1b49b6 ("ext4: goto right label 'failed_mount3a'") thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 89481b5fa8c0640e62ba84c6020cee895f7ac643 Mon Sep 17 00:00:00 2001 From: Baokun Li Date: Wed, 9 Nov 2022 15:43:43 +0800 Subject: [PATCH] ext4: correct inconsistent error msg in nojournal mode When we used the journal_async_commit mounting option in nojournal mode, the kernel told me that "can't mount with journal_checksum", was very confusing. I find that when we mount with journal_async_commit, both the JOURNAL_ASYNC_COMMIT and EXPLICIT_JOURNAL_CHECKSUM flags are set. However, in the error branch, CHECKSUM is checked before ASYNC_COMMIT. As a result, the above inconsistency occurs, and the ASYNC_COMMIT branch becomes dead code that cannot be executed. Therefore, we exchange the positions of the two judgments to make the error msg more accurate. Signed-off-by: Baokun Li Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20221109074343.4184862-1-libaokun1@huawei.com Signed-off-by: Theodore Ts'o Cc: stable@kernel.org diff --git a/fs/ext4/super.c b/fs/ext4/super.c index f5e6919ea650..878be47faaaf 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -5288,14 +5288,15 @@ static int __ext4_fill_super(struct fs_context *fc, struct super_block *sb) goto failed_mount3a; } else { /* Nojournal mode, all journal mount options are illegal */ - if (test_opt2(sb, EXPLICIT_JOURNAL_CHECKSUM)) { + if (test_opt(sb, JOURNAL_ASYNC_COMMIT)) { ext4_msg(sb, KERN_ERR, "can't mount with " - "journal_checksum, fs mounted w/o journal"); + "journal_async_commit, fs mounted w/o journal"); goto failed_mount3a; } - if (test_opt(sb, JOURNAL_ASYNC_COMMIT)) { + + if (test_opt2(sb, EXPLICIT_JOURNAL_CHECKSUM)) { ext4_msg(sb, KERN_ERR, "can't mount with " - "journal_async_commit, fs mounted w/o journal"); + "journal_checksum, fs mounted w/o journal"); goto failed_mount3a; } if (sbi->s_commit_interval != JBD2_DEFAULT_MAX_COMMIT_AGE*HZ) {