From patchwork Mon Apr 10 17:20:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guoqing Cai X-Patchwork-Id: 1767230 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=ozlabs.org (client-ip=2404:9400:2221:ea00::3; helo=gandalf.ozlabs.org; envelope-from=srs0=+lyy=ab=vger.kernel.org=linux-ext4-owner@ozlabs.org; receiver=) Received: from gandalf.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PwG4T3j7Wz1yZP for ; Tue, 11 Apr 2023 03:22:16 +1000 (AEST) Received: from gandalf.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by gandalf.ozlabs.org (Postfix) with ESMTP id 4PwG4Q3dTkz4xFh for ; Tue, 11 Apr 2023 03:22:14 +1000 (AEST) Received: by gandalf.ozlabs.org (Postfix) id 4PwG4Q3ZPJz4xFq; Tue, 11 Apr 2023 03:22:14 +1000 (AEST) Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: gandalf.ozlabs.org; dmarc=none (p=none dis=none) header.from=hust.edu.cn Authentication-Results: gandalf.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=linux-ext4-owner@vger.kernel.org; receiver=) Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by gandalf.ozlabs.org (Postfix) with ESMTP id 4PwG4Q0s9Wz4xFh for ; Tue, 11 Apr 2023 03:22:14 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230236AbjDJRWN (ORCPT ); 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 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; } /**