Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp4427045rwl; Mon, 10 Apr 2023 10:51:28 -0700 (PDT) X-Google-Smtp-Source: AKy350a5WRmu/GrSD7NuE9wiQbQtDmdG9bjC0R1GWEb6mFHSnmnLvGpxa4cna0KWZoUN4/iLy1AY X-Received: by 2002:a17:902:7593:b0:1a5:dfd:d167 with SMTP id j19-20020a170902759300b001a50dfdd167mr12867928pll.8.1681149087944; Mon, 10 Apr 2023 10:51:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681149087; cv=none; d=google.com; s=arc-20160816; b=cULdcjYsQh8aG1ca9hBQNSzQyBqbPXL6n3Cs3eyTXtypXG070sfVKDfw3hkEHgyJyK efNpwH9gfsKelu4imZ9bXt59q546hY440vc3DKk2CLfSS87xewp7uCq7ZnxzseNkom5h F8K94USLPL5JtnQNJTJcjAIo3y8nmQkUxsgowAk1T5VH6TR8FVxd6VxDb+NzwMHeAIcl 84Mf5ISBVD7M90pbBn2XinkboZS92XwtDRYIWBfT7XpV43bRp1i5gTrKlIsSkIVfWQ1p Hn3dlTA0gQGNaGuM45bWUhFTiktp8Dc3FieFUT7pTKEv4FqOOyvVp7BWwjxhi2BKbBW7 ur+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=tY4rhlT9v0CjN6cOt7tAC42J/F5PCVu4KNDxWqkL0pQ=; b=y1QNJ6FTkuLA/B6VAUEADkddyijPrhdKcZsZRIk16v7zBD3GyS0Q9E409GHtYvQkej a73UVm/57T5wrXVCwszmdvvWKzosVPgUBDZPgiAlExZowqRlb/6+ghW8+epNweCxi6t/ GEijsjNJuU3bE/uT4MjFLcP9Fo5EnG1DhFG46wTqtTn2iCdB4vvatqy3Hx+BgQu/YYv7 7qoX1d0wWeCxl1+PzuR3TdrYrcRFJmgJmgfCcNoYYAiRL3pWBF+ZwOgFYfQE+lsNtfid gc7Aj9GGael5aXxZFWtoAZc81FiRCFV9L6U9P6doWgQme1GrZyMRqddhyJP1AVemvclW VY9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="G/G2jOWO"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s14-20020a63e80e000000b004fb95c8f647si10850189pgh.407.2023.04.10.10.51.12; Mon, 10 Apr 2023 10:51:27 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="G/G2jOWO"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229731AbjDJRpt (ORCPT + 99 others); Mon, 10 Apr 2023 13:45:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229503AbjDJRps (ORCPT ); Mon, 10 Apr 2023 13:45:48 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A8DC171C; Mon, 10 Apr 2023 10:45:47 -0700 (PDT) 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 B965B610A3; Mon, 10 Apr 2023 17:45:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1CC0DC433D2; Mon, 10 Apr 2023 17:45:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1681148746; bh=Q72b34YBtc7OXzlvOQZ3dPKBZ4tw4gB1Uk02Sk+ZOxk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=G/G2jOWOmBcqah9uKdDP7U0f+PCmS5RTT9H0cTBuVaFjX7PfIKGfmy0XkQI5BInZr 3NvcwNYSGElLLQg2L8tvKzVJc5HlMdL3NnvKlgvO3t8XPttosac3Bm377sBBC0ZvJZ o6delpRrwT7W7L7Elhd/NpV5+o7b5X3vvtrURuIkbD2E4PeDDi1trJVBc07rH1Ai/e FEll0jV9xkFBUMAEcPV7hGvGqNgs2xtVHWApf8KfDBuIKlrpm4EIAuaEEqc93yW+gD o2L37UUddeCbp7Cggouqwfgu8oOFCxolY/CPffCF6xVwWzOEd9A6088yKp04+LhoG2 ZGl3RFt3wH9yg== Date: Mon, 10 Apr 2023 10:45:45 -0700 From: "Darrick J. Wong" To: Guoqing Cai Cc: Theodore Ts'o , Jan Kara , HUST OS Kernel Contribution , Dongliang Mu , linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] fs: jbd2: fix an incorrect warn log Message-ID: <20230410174545.GA360877@frogsfrogsfrogs> References: <20230410172039.1752440-1-u202112087@hust.edu.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230410172039.1752440-1-u202112087@hust.edu.cn> X-Spam-Status: No, score=-5.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, 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 On Tue, Apr 11, 2023 at 01:20:38AM +0800, Guoqing Cai wrote: > 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; Why wouldn't you warn about the journal reset failing here? --D > > journal->j_flags |= JBD2_LOADED; > return 0; > - > -recovery_error: > - printk(KERN_WARNING "JBD2: recovery failed\n"); > - return -EIO; > } > > /** > -- > 2.40.0 >