Commit 780f66e5 authored by zhangyi (F)'s avatar zhangyi (F) Committed by Theodore Ts'o

jbd2: improve comments about freeing data buffers whose page mapping 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/20200217112706.20085-1-yi.zhang@huawei.com
Fixes: c96dceea ("jbd2: do not clear the BH_Mapped flag when forgetting a metadata buffer")
Suggested-by: default avatarJan Kara <jack@suse.cz>
Reviewed-by: default avatarJan Kara <jack@suse.cz>
Signed-off-by: default avatarzhangyi (F) <yi.zhang@huawei.com>
Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
parent 6cfb061f
...@@ -997,9 +997,10 @@ void jbd2_journal_commit_transaction(journal_t *journal) ...@@ -997,9 +997,10 @@ void jbd2_journal_commit_transaction(journal_t *journal)
* journalled data) we need to unmap buffer and clear * journalled data) we need to unmap buffer and clear
* more bits. We also need to be careful about the check * more bits. We also need to be careful about the check
* because the data page mapping can get cleared under * because the data page mapping can get cleared under
* out hands, which alse need not to clear more bits * our hands. Note that if mapping == NULL, we don't
* because the page and buffers will be freed and can * need to make buffer unmapped because the page is
* never be reused once we are done with them. * already detached from the mapping and buffers cannot
* get reused.
*/ */
mapping = READ_ONCE(bh->b_page->mapping); mapping = READ_ONCE(bh->b_page->mapping);
if (mapping && !sb_is_blkdev_sb(mapping->host->i_sb)) { if (mapping && !sb_is_blkdev_sb(mapping->host->i_sb)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment