Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1395383ybv; Thu, 6 Feb 2020 03:20:16 -0800 (PST) X-Google-Smtp-Source: APXvYqzxb6jMlMz97igsF1uENL0MIsdQGqag4rWPmMW9CMWcCD0kmYU8V+FOG4g8TiqG95Gf2MyE X-Received: by 2002:aca:c1c2:: with SMTP id r185mr6857263oif.19.1580988016184; Thu, 06 Feb 2020 03:20:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580988016; cv=none; d=google.com; s=arc-20160816; b=cHVqwuWgCWCCMBqEAOArWBbOxqIcbc1DCKv0F7UsnUfu/A5AiiPpyG2RpgosN+KRdd vmdS2KuCitV7UYJtNQRkspNINejjsUL8gK/6lzCqbeCha+tip5frOj9afDLOR8Jn8lpT qbXGj8Svss/9i5ZqfuGA7X8kguLZoGto2M1fMopfh2Otr3WfoKpnANtP1ooJZadhEPwO 5UdR3eMKtJI9s0zI0fXq9Jqwk9Y2pLMRtKXIOCmpFEhtiLxxZkatib9eivwyr376xZK1 lNcgE2GlsJ96U512pPSkhAikdJAKZmJnlbBbEsCBXD1euMeBMBRjNQcd/E+DgFaWULvO 5nlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=sXG0b8+neZ+H0RbSCZ0LnLF23qm68ATxVUcICDFtO9U=; b=lx7fcS+Hp3fN8kwtmXZfdsFGA0zUObRBd6VEgjQYS4Ri4kxUV2QNPtAEZ8aViW7q4g hYMVzbRFLOl1JZiBhHFyxPquBx/Yc1WA0ZOQ1i67f1e2XU1QamWtwjwHEkByTzLcN8Ru SFIw3fcBiJBr9roYpYmbxaLAndXnaac98gU2znSrvGXdoxv5ksiufBy/3x4l8HUVbzK7 OZyIKLYsNFT0vejsn+rGaLKxyddJELl8XfO+k9ykw1a+/X8JWc8Uygm4l8JfOYyAgJsA +keWiXvpCsTIoaMPYGES7UJy+DbUdaXERTVaNcc2ftcLWoRJlkYHtIWU1g+GLr43oa5j YzJQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a14si1902218otk.2.2020.02.06.03.19.59; Thu, 06 Feb 2020 03:20:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726365AbgBFLDm (ORCPT + 99 others); Thu, 6 Feb 2020 06:03:42 -0500 Received: from mx2.suse.de ([195.135.220.15]:59126 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727007AbgBFLDm (ORCPT ); Thu, 6 Feb 2020 06:03:42 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 2DD86B116; Thu, 6 Feb 2020 11:03:37 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 2A4151E0E31; Thu, 6 Feb 2020 12:03:35 +0100 (CET) Date: Thu, 6 Feb 2020 12:03:35 +0100 From: Jan Kara To: "zhangyi (F)" Cc: jack@suse.cz, tytso@mit.edu, linux-ext4@vger.kernel.org, luoshijie1@huawei.com, zhangxiaoxu5@huawei.com Subject: Re: [PATCH 1/2] jbd2: move the clearing of b_modified flag to the journal_unmap_buffer() Message-ID: <20200206110335.GA3994@quack2.suse.cz> References: <20200203140458.37397-1-yi.zhang@huawei.com> <20200203140458.37397-2-yi.zhang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200203140458.37397-2-yi.zhang@huawei.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Mon 03-02-20 22:04:57, zhangyi (F) wrote: > There is no need to delay the clearing of b_modified flag to the > transaction committing time when unmapping the journalled buffer, so > just move it to the journal_unmap_buffer(). > > Signed-off-by: zhangyi (F) Thanks for the patch. It looks good, just one small comment below: > diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c > index e77a5a0b4e46..a479cbf8ae54 100644 > --- a/fs/jbd2/transaction.c > +++ b/fs/jbd2/transaction.c > @@ -2337,11 +2337,7 @@ static int journal_unmap_buffer(journal_t *journal, struct buffer_head *bh, > set_buffer_freed(bh); > if (journal->j_running_transaction && buffer_jbddirty(bh)) > jh->b_next_transaction = journal->j_running_transaction; > - spin_unlock(&journal->j_list_lock); > - spin_unlock(&jh->b_state_lock); > - write_unlock(&journal->j_state_lock); > - jbd2_journal_put_journal_head(jh); > - return 0; > + may_free = 0; I'd rather add b_modified clearing here than trying to reuse the tail of the function. Because this condition is different from the other ones that end up in zap_buffer_locked - here we really want to keep bh and jh mostly intact. Honza -- Jan Kara SUSE Labs, CR