Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4730436ybv; Mon, 17 Feb 2020 04:54:55 -0800 (PST) X-Google-Smtp-Source: APXvYqyuue0PXel8wiCpU4ngDsh8Lu92icpxFijn6/eh7SbvzYZvuNrmfFhT8chlnjuA0mA1iSCO X-Received: by 2002:aca:dc04:: with SMTP id t4mr9420941oig.51.1581944094867; Mon, 17 Feb 2020 04:54:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581944094; cv=none; d=google.com; s=arc-20160816; b=s3cmHtUIr8GD209mlet3Fjl9Djx2HdyzvnDGEGMfDhTVtZH5b6RpoIjsqlYZVnGgdr TrBCTilseDacvMklk7yM6acD8PHaQu4pqDOU3tIRzbvI1Ase5W/QdBuDQOBG3F2tQ8Hy 32ISIltD8ahQmP6E8nwaXFQwS8VIv7bKVcKgpEBdV2rPHy9K9KsGBWHqx1GDSmGABqIi A1sibAzINQD5RwcqvQASYE/gectLm5r65/yzk2jPorV2hwXDNzR3cX/ouYxVbva+04Ra ycxHZeOGidL1ViFEpa4bXf8PLcqfa3roB4jkBqAGEmDmT65liEKY3uvyImKKuh6F4BLc kNiw== 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=JcLTq6N4ajd0NZ5478WfI6UuWp7Tfxx10WKU3YR6wTA=; b=Q4kcoA7ADfoe3jMbwQX9nJX5ZRX/5DxqJi6OH1OCchCX4zrQetoWtU03hB83QVSKe2 WrX1kbSiYwUb5WiKdkHQYInrSVJPeLLmv/HBU1mlrJ5+fSS0weyMLuPoBLkFcTh+Tiqf B15q9y8rM2DopFp3iVVMsusOGo7GDB5sfF9dlOFJSaMGF/l/3l5CetZuDRZsGIV39A0D cj9eTI/5blgt17h0EQEz+7fTlRsyYwGIUMA6raiCIVIpO6I1HO1ggShny1TPp0UtoKt5 ejVlvXVzFdrb3pq8mFLx84XSut+zkfmHfD5pCqNxURQtSq+Qn6lcxmzO+V53axL2eiB0 cHYg== 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 c4si180460ots.107.2020.02.17.04.54.38; Mon, 17 Feb 2020 04:54:54 -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 S1727503AbgBQMVd (ORCPT + 99 others); Mon, 17 Feb 2020 07:21:33 -0500 Received: from mx2.suse.de ([195.135.220.15]:54938 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726932AbgBQMVd (ORCPT ); Mon, 17 Feb 2020 07:21:33 -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 00AD8B080; Mon, 17 Feb 2020 12:21:32 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 7D1981E0D47; Mon, 17 Feb 2020 13:21:31 +0100 (CET) Date: Mon, 17 Feb 2020 13:21:31 +0100 From: Jan Kara To: "zhangyi (F)" Cc: linux-ext4@vger.kernel.org, jack@suse.cz, tytso@mit.edu Subject: Re: [PATCH] jbd2: improve comments about freeing data buffers whose page mapping is NULL Message-ID: <20200217122131.GG12032@quack2.suse.cz> References: <20200217112706.20085-1-yi.zhang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200217112706.20085-1-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 17-02-20 19:27:06, zhangyi (F) wrote: > Improve comments in jbd2_journal_commit_transaction() to describe why > we don't need to clear the buffer_mapped bit for freeing file mapping > buffers whose page mapping is NULL. > > Fixes: c96dceeabf76 ("jbd2: do not clear the BH_Mapped flag when forgetting a metadata buffer") > Signed-off-by: zhangyi (F) > Suggested-by: Jan Kara Thanks! You can add: Reviewed-by: Jan Kara Honza > --- > fs/jbd2/commit.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c > index 27373f5792a4..e855d8260433 100644 > --- a/fs/jbd2/commit.c > +++ b/fs/jbd2/commit.c > @@ -997,9 +997,10 @@ void jbd2_journal_commit_transaction(journal_t *journal) > * journalled data) we need to unmap buffer and clear > * more bits. We also need to be careful about the check > * because the data page mapping can get cleared under > - * out hands, which alse need not to clear more bits > - * because the page and buffers will be freed and can > - * never be reused once we are done with them. > + * our hands. Note that if mapping == NULL, we don't > + * need to make buffer unmapped because the page is > + * already detached from the mapping and buffers cannot > + * get reused. > */ > mapping = READ_ONCE(bh->b_page->mapping); > if (mapping && !sb_is_blkdev_sb(mapping->host->i_sb)) { > -- > 2.17.2 > -- Jan Kara SUSE Labs, CR