Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CB176C4361B for ; Wed, 16 Dec 2020 10:12:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7EDF42313B for ; Wed, 16 Dec 2020 10:12:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725889AbgLPKMa (ORCPT ); Wed, 16 Dec 2020 05:12:30 -0500 Received: from mx2.suse.de ([195.135.220.15]:43496 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725820AbgLPKMa (ORCPT ); Wed, 16 Dec 2020 05:12:30 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id A1037AC7F; Wed, 16 Dec 2020 10:11:48 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 2963D1E135E; Wed, 16 Dec 2020 11:11:47 +0100 (CET) Date: Wed, 16 Dec 2020 11:11:47 +0100 From: Jan Kara To: harshad shirwadkar Cc: Jan Kara , Ted Tso , Ext4 Developers List Subject: Re: [PATCH 08/12] ext4: Combine ext4_handle_error() and save_error_info() Message-ID: <20201216101147.GB21258@quack2.suse.cz> References: <20201127113405.26867-1-jack@suse.cz> <20201127113405.26867-9-jack@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Mon 14-12-20 11:23:04, harshad shirwadkar wrote: > On Fri, Nov 27, 2020 at 3:38 AM Jan Kara wrote: > > > > save_error_info() is always called together with ext4_handle_error(). > > Combine them into a single call and move unconditional bits out of > > save_error_info() into ext4_handle_error(). > > > > Signed-off-by: Jan Kara > > --- > > fs/ext4/super.c | 31 +++++++++++++++---------------- > > 1 file changed, 15 insertions(+), 16 deletions(-) > > > > diff --git a/fs/ext4/super.c b/fs/ext4/super.c > > index 2d7dc0908cdd..73a09b73fc11 100644 > > --- a/fs/ext4/super.c > > +++ b/fs/ext4/super.c > > @@ -592,9 +592,6 @@ static void __save_error_info(struct super_block *sb, int error, > > { > > struct ext4_sb_info *sbi = EXT4_SB(sb); > > > > - EXT4_SB(sb)->s_mount_state |= EXT4_ERROR_FS; > > - if (bdev_read_only(sb->s_bdev)) > > - return; > > /* We default to EFSCORRUPTED error... */ > > if (error == 0) > > error = EFSCORRUPTED; ... > > @@ -944,13 +943,13 @@ __acquires(bitlock) > > if (test_opt(sb, ERRORS_CONT)) { > > if (test_opt(sb, WARN_ON_ERROR)) > > WARN_ON_ONCE(1); > > + EXT4_SB(sb)->s_mount_state |= EXT4_ERROR_FS; > Since you moved the bdev_read_only() check from __save_error_info to > ext4_handle_error(), should we add that check here? Thanks for the review! Now that I'm looking at it, you're probably right it would be safer. That being said I don't think it really matters: a) Because I don't think this function can get called on read-only bdev b) Because functions processing the work item will find out the sb is read-only and won't do anything. But it's really wasted work. I can see Ted didn't merge this patch yet. So I'll resend the series from this patch because after fixing this it required a bit of rebasing. Also I have two more additional fixes in the series based on Andreas' feedback. Thanks again for looking into the series! Honza -- Jan Kara SUSE Labs, CR