Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp4403659rwl; Mon, 10 Apr 2023 10:28:32 -0700 (PDT) X-Google-Smtp-Source: AKy350aW0MSeKBbrZ3UC5V+EuIq6GBV+RCvsAJbAwlGJn5Hd/dwJDvRvUIjsaSYF9Bl6xFdNPT0l X-Received: by 2002:a17:90b:1d8a:b0:23f:9fac:6b35 with SMTP id pf10-20020a17090b1d8a00b0023f9fac6b35mr14817849pjb.39.1681147712410; Mon, 10 Apr 2023 10:28:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681147712; cv=none; d=google.com; s=arc-20160816; b=L8SOfUv/A2E+JZpo0rQfU4mayQWcoWFNpCyOUa10CE0ydtKC1NI7nkOG2F7c8ViqkE EqjJmRDvTCiLigFH2zE+MizY2KKZZM+FWYKXBoYkItXJjvmWvdVsqjdIwN3hWpReNG7R ZdNIy4lfTT935JUmTU2/ZDzt9JRpUPvsDZgiW3h2RpFC/OTYk3iLbD9yVpJINQWudKXs i356z9b+Z0uBbdJi4+N4fIYHSJ8sWT/Zw/EZUOB3XDeMR/HQhsdBFWojyEBfZjZFlCXc bnKt1eyHoNy76HrvUt5KXzrijLfRzoQZvwfO3Ibr6QnxZShCsqkETP8rijqkID6A4zmC b3Ug== 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 :message-id:date:subject:cc:to:from; bh=yamK8Vd9O4MICYOU5XsQHKBfnRk3urh0IssM91VwmVw=; b=zeIT0lJS1qvaKXxqJ7WNBs6InOQ2iyXUpfVQ5fod1U2x27lfG0+rK6maxyC+5/nAjW QRVzFK1qEdpceq4WpE8h2IUtZ8T9Ca5aCrboe7AgewC1tYNTNzOhbjpPxxSUIS37jHr8 qZW1Jvbqr4Wbs+3ZcNNnRISFqEaApgGZx+ZkxXtBHQphP/Adz8NKno1RvlnaSgDOk6Wx po2E+YKA6iQfzuYjqpXIaiF1EK4j7Gmdf3Bp3OIAyRhroOg8e2P64FGJzSjJNGzHJIrg beThEH0qS+ULNRfbNW4VSkQuSyNti8F2krIORihVD7ZDmQLaDQsjcGewnxxBCD8WQCpT jbaw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r13-20020a170902e3cd00b0019f27fe9d45si10857780ple.463.2023.04.10.10.28.15; Mon, 10 Apr 2023 10:28:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-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-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230027AbjDJRWN (ORCPT + 99 others); Mon, 10 Apr 2023 13:22:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229789AbjDJRWM (ORCPT ); Mon, 10 Apr 2023 13:22:12 -0400 Received: from hust.edu.cn (unknown [202.114.0.240]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83C252114; Mon, 10 Apr 2023 10:22:11 -0700 (PDT) Received: from localhost.localdomain ([172.16.0.254]) (user=u202112087@hust.edu.cn mech=LOGIN bits=0) by mx1.hust.edu.cn with ESMTP id 33AHLcbu007619-33AHLcbv007619 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 11 Apr 2023 01:21:53 +0800 From: Guoqing Cai To: "Theodore Ts'o" , Jan Kara Cc: HUST OS Kernel Contribution , Guoqing Cai , Dongliang Mu , linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] fs: jbd2: fix an incorrect warn log Date: Tue, 11 Apr 2023 01:20:38 +0800 Message-Id: <20230410172039.1752440-1-u202112087@hust.edu.cn> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-FEAS-AUTH-USER: u202112087@hust.edu.cn X-Spam-Status: No, score=-0.0 required=5.0 tests=SPF_HELO_PASS,SPF_PASS autolearn=unavailable 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 In jbd2_journal_load(), when journal_reset fails, it prints an incorrect warn log. Fix this by changing the goto statement to return statement. Signed-off-by: Guoqing Cai Reviewed-by: Dongliang Mu --- fs/jbd2/journal.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index e80c781731f8..555f09ca1d99 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c @@ -2082,8 +2082,10 @@ int jbd2_journal_load(journal_t *journal) /* Let the recovery code check whether it needs to recover any * data from the journal. */ - if (jbd2_journal_recover(journal)) - goto recovery_error; + if (jbd2_journal_recover(journal)) { + printk(KERN_WARNING "JBD2: recovery failed\n"); + return -EIO; + } if (journal->j_failed_commit) { printk(KERN_ERR "JBD2: journal transaction %u on %s " @@ -2101,14 +2103,10 @@ int jbd2_journal_load(journal_t *journal) * reinitialise the dynamic contents of the superblock in memory * and reset them on disk. */ if (journal_reset(journal)) - goto recovery_error; + return -EIO; journal->j_flags |= JBD2_LOADED; return 0; - -recovery_error: - printk(KERN_WARNING "JBD2: recovery failed\n"); - return -EIO; } /** -- 2.40.0