Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp284217pxp; Wed, 9 Mar 2022 02:56:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJx61SuHEcYzYeEW5aTxYb/kYnKKxnA1p94KV/Rp6ReY6kwyLKfYRqSPiZqPIZODtFoUIfvG X-Received: by 2002:a17:907:3d92:b0:6da:8247:cbf1 with SMTP id he18-20020a1709073d9200b006da8247cbf1mr16563621ejc.205.1646823416668; Wed, 09 Mar 2022 02:56:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646823416; cv=none; d=google.com; s=arc-20160816; b=wwDfcfRziFKuLhPZjlShXwsVmcMcrqvd0Im3DQxIWuwdao3KB3RinE1bSjE4XK+f+a 03RGm/KT6dkyAzPATkpAruGUcnHRkbfCNp4HlcyeFEg+4Jj4p8iBHhy/NX8DPq3Lcmkc 5HRSN66L120WEE3TPKM8fg/gAFpKnlxpKCTXxEiTBse3tp6ZzSpg19GqdycTdvAfypdt aSKnPUxmETP5LsS2N+j6LbUV9cD1HTsstD/TNPeujyxL+d8p2cHNq2j9S4rOmrgtlKVK mIzL9P7zoWov03C8JeA4boFPnYXpu87HFGk3kXyrEQwPvpXGf7yDO65BUp/cZN/6VPvf 1+/Q== 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 :dkim-signature; bh=U5IcDzlNsbdkZ+2DQb9QEkG5NusgUMbdqFqIDV1gKwg=; b=SN+wndrKhzFIfD/+XwZKP7eJy4M5uYco+yxQikei6x6xCDhdajt41Bb5/xH1Ggd907 7SfYBOfL3OGSkwPAkd9d6uZNYVUu3kC1+zjOUHrXkdwJRdjuAtG9/EuOoeGgoVNveash uSR0FdOYSPs4rdCXsDfRHs9r7ys98AFxYmQAWlPE0F+7FNTjSTrNMMce32jAtcfBuqYK NucFD8SX9X0mMDxvSin1vCc2iKaV1Fh+FJTlWi7Vv7McKyEhe2qRoWf3Zs8z3u0C1T9l Bwi74zsMtpAi7THS9Rsb0I4tjx78gsyn+5j0I4RGL1/6tdSrXTDpmZOs28qZylyjsKFw xGSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=wLhn0w4G; dkim=neutral (no key) header.i=@suse.cz; 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 f11-20020a0564021e8b00b004168e0aa9f7si1318717edf.130.2022.03.09.02.56.26; Wed, 09 Mar 2022 02:56:56 -0800 (PST) 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=@suse.cz header.s=susede2_rsa header.b=wLhn0w4G; dkim=neutral (no key) header.i=@suse.cz; 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 S229836AbiCIJxu (ORCPT + 99 others); Wed, 9 Mar 2022 04:53:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229922AbiCIJxu (ORCPT ); Wed, 9 Mar 2022 04:53:50 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A1FBCDF for ; Wed, 9 Mar 2022 01:52:49 -0800 (PST) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 8AD9E210F4; Wed, 9 Mar 2022 09:52:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1646819568; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=U5IcDzlNsbdkZ+2DQb9QEkG5NusgUMbdqFqIDV1gKwg=; b=wLhn0w4GgFdVf55DeXi50StjRoFAcxtcS/rcG5G5QvHlDcToTExwUY9QrHSPcwzxcs3cGm +h/qZLfWv+HbzjwuHzexIGGkzVR4NslTYIdatPx5lv4XxR1ghg74jVx+WR1gpMownhwZP6 zqlut0hUyjAlfygrmKM+OBCT7mRCrOg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1646819568; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=U5IcDzlNsbdkZ+2DQb9QEkG5NusgUMbdqFqIDV1gKwg=; b=U7flW5pfiM18dfaGaYVmWdqhSlaVuDkodBw3DHxWhx5eTCYsTax3MnjGJosz/ksBcDy9pX UVKa7IrXEL4mtSAw== Received: from quack3.suse.cz (unknown [10.163.43.118]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 76D3BA3B85; Wed, 9 Mar 2022 09:52:48 +0000 (UTC) Received: by quack3.suse.cz (Postfix, from userid 1000) id 25E6DA060B; Wed, 9 Mar 2022 10:52:48 +0100 (CET) Date: Wed, 9 Mar 2022 10:52:48 +0100 From: Jan Kara To: harshad shirwadkar Cc: Jan Kara , Ext4 Developers List , Ritesh Harjani , "Theodore Y. Ts'o" Subject: Re: [PATCH 3/5] ext4: for committing inode, make ext4_fc_track_inode wait Message-ID: <20220309095248.v7kj3ss2kn6kva54@quack3.lan> References: <20220308105112.404498-1-harshads@google.com> <20220308105112.404498-4-harshads@google.com> <20220308123020.u4357jwbtoqhy5xd@quack3.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 08-03-22 05:06:51, harshad shirwadkar wrote: > On Tue, 8 Mar 2022 at 04:30, Jan Kara wrote: > > > diff --git a/fs/ext4/ext4_jbd2.c b/fs/ext4/ext4_jbd2.c > > > index 3477a16d08ae..7fa301b0a35a 100644 > > > --- a/fs/ext4/ext4_jbd2.c > > > +++ b/fs/ext4/ext4_jbd2.c > > > @@ -106,6 +106,18 @@ handle_t *__ext4_journal_start_sb(struct super_block *sb, unsigned int line, > > > GFP_NOFS, type, line); > > > } > > > > > > +handle_t *__ext4_journal_start(struct inode *inode, unsigned int line, > > > + int type, int blocks, int rsv_blocks, > > > + int revoke_creds) > > > +{ > > > + handle_t *handle = __ext4_journal_start_sb(inode->i_sb, line, > > > + type, blocks, rsv_blocks, > > > + revoke_creds); > > > + if (ext4_handle_valid(handle) && !IS_ERR(handle)) > > > + ext4_fc_track_inode(handle, inode); > > > > Why do you need to call ext4_fc_track_inode() here? Calls in > > ext4_map_blocks() and ext4_mark_iloc_dirty() should be enough, shouldn't > > they? > This is just a precautionary call. ext4_fc_track_inode is an > idempotent function, so it doesn't matter if it gets called multiple > times. This check just covers cases (such as the ones in inline.c) > where ext4_reserve_inode_write() doesn't get called. I saw a few > failures in the log group when I remove this call. The right way to > fix this though is to ensure that ext4_reserve_inode_write() gets > called before every inode update. Oh, you mean like when updating inline data? I'm not sure ext4_reserve_inode_write() is usable for all the places in inline.c but yes, you probably need some sprinkling of ext4_fc_track_inode() there. That would be definitely better than hacking it around in __ext4_journal_start(). Honza -- Jan Kara SUSE Labs, CR