lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200217122131.GG12032@quack2.suse.cz>
Date:   Mon, 17 Feb 2020 13:21:31 +0100
From:   Jan Kara <jack@...e.cz>
To:     "zhangyi (F)" <yi.zhang@...wei.com>
Cc:     linux-ext4@...r.kernel.org, jack@...e.cz, tytso@....edu
Subject: Re: [PATCH] jbd2: improve comments about freeing data buffers whose
 page mapping is NULL

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) <yi.zhang@...wei.com>
> Suggested-by: Jan Kara <jack@...e.cz>

Thanks! You can add:

Reviewed-by: Jan Kara <jack@...e.cz>

								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 <jack@...e.com>
SUSE Labs, CR

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ