Skip to content

Commit

Permalink
jbd2: improve comments about freeing data buffers whose page mapping …
Browse files Browse the repository at this point in the history
…is NULL

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.

Link: https://lore.kernel.org/r/[email protected]
Fixes: c96dcee ("jbd2: do not clear the BH_Mapped flag when forgetting a metadata buffer")
Suggested-by: Jan Kara <[email protected]>
Reviewed-by: Jan Kara <[email protected]>
Signed-off-by: zhangyi (F) <[email protected]>
Signed-off-by: Theodore Ts'o <[email protected]>
  • Loading branch information
zhangyi089 authored and tytso committed Mar 6, 2020
1 parent 6cfb061 commit 780f66e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions fs/jbd2/commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit 780f66e

Please sign in to comment.