All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] jbd2: improve comments about freeing data buffers whose page mapping is NULL
@ 2020-02-17 11:27 zhangyi (F)
  2020-02-17 12:21 ` Jan Kara
  2020-03-06  1:14 ` Theodore Y. Ts'o
  0 siblings, 2 replies; 3+ messages in thread
From: zhangyi (F) @ 2020-02-17 11:27 UTC (permalink / raw)
  To: linux-ext4; +Cc: jack, tytso, yi.zhang

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@huawei.com>
Suggested-by: Jan Kara <jack@suse.cz>
---
 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] jbd2: improve comments about freeing data buffers whose page mapping is NULL
  2020-02-17 11:27 [PATCH] jbd2: improve comments about freeing data buffers whose page mapping is NULL zhangyi (F)
@ 2020-02-17 12:21 ` Jan Kara
  2020-03-06  1:14 ` Theodore Y. Ts'o
  1 sibling, 0 replies; 3+ messages in thread
From: Jan Kara @ 2020-02-17 12:21 UTC (permalink / raw)
  To: zhangyi (F); +Cc: linux-ext4, jack, tytso

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@huawei.com>
> Suggested-by: Jan Kara <jack@suse.cz>

Thanks! You can add:

Reviewed-by: Jan Kara <jack@suse.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@suse.com>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] jbd2: improve comments about freeing data buffers whose page mapping is NULL
  2020-02-17 11:27 [PATCH] jbd2: improve comments about freeing data buffers whose page mapping is NULL zhangyi (F)
  2020-02-17 12:21 ` Jan Kara
@ 2020-03-06  1:14 ` Theodore Y. Ts'o
  1 sibling, 0 replies; 3+ messages in thread
From: Theodore Y. Ts'o @ 2020-03-06  1:14 UTC (permalink / raw)
  To: zhangyi (F); +Cc: linux-ext4, jack

On Mon, Feb 17, 2020 at 07:27:06PM +0800, 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@huawei.com>
> Suggested-by: Jan Kara <jack@suse.cz>

Thanks, applied.

					- Ted

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-03-06  1:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-17 11:27 [PATCH] jbd2: improve comments about freeing data buffers whose page mapping is NULL zhangyi (F)
2020-02-17 12:21 ` Jan Kara
2020-03-06  1:14 ` Theodore Y. Ts'o

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.