aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzhangyi (F) <[email protected]>2020-02-17 19:27:06 +0800
committerTheodore Ts'o <[email protected]>2020-03-05 20:25:05 -0500
commit780f66e59231fcf882f36c63f287252ee47cc75a (patch)
tree893f357631fc8f070e9f9b84f43c87a772aa236c
parent6cfb061fe9e901dd0b6cfa3ed50bc39c81523532 (diff)
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/[email protected] Fixes: c96dceeabf76 ("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]>
-rw-r--r--fs/jbd2/commit.c7
1 files 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 @@ restart_loop:
* 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)) {