Btrfs: Avoid superfluous tree-log writeout
We allow two log transactions at a time, but use same flag to mark dirty tree-log btree blocks. So we may flush dirty blocks belonging to newer log transaction when committing a log transaction. This patch fixes the issue by using two flags to mark dirty tree-log btree blocks. Signed-off-by: Yan Zheng <zheng.yan@oracle.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
@@ -980,12 +980,12 @@ int btrfs_free_log_root_tree(struct btrfs_trans_handle *trans,
|
||||
|
||||
while (1) {
|
||||
ret = find_first_extent_bit(&log_root_tree->dirty_log_pages,
|
||||
0, &start, &end, EXTENT_DIRTY);
|
||||
0, &start, &end, EXTENT_DIRTY | EXTENT_NEW);
|
||||
if (ret)
|
||||
break;
|
||||
|
||||
clear_extent_dirty(&log_root_tree->dirty_log_pages,
|
||||
start, end, GFP_NOFS);
|
||||
clear_extent_bits(&log_root_tree->dirty_log_pages, start, end,
|
||||
EXTENT_DIRTY | EXTENT_NEW, GFP_NOFS);
|
||||
}
|
||||
eb = fs_info->log_root_tree->node;
|
||||
|
||||
|
Reference in New Issue
Block a user