From ed25dab3a0d1b14b59a3ad74b9d6bb4f4dca03b8 Mon Sep 17 00:00:00 2001 From: Josef Bacik Date: Thu, 26 Jan 2023 16:00:55 -0500 Subject: btrfs: add trans argument to btrfs_clean_tree_block We check the header generation in the extent buffer against the current running transaction id to see if it's safe to clear DIRTY on this buffer. Generally speaking if we're clearing the buffer dirty we're holding the transaction open, but in the case of cleaning up an aborted transaction we don't, so we have extra checks in that path to check the transid. To allow for a future cleanup go ahead and pass in the trans handle so we don't have to rely on ->running_transaction being set. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba --- fs/btrfs/tree-log.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'fs/btrfs/tree-log.c') diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index 997ba92481cb..e683fbb9bb30 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -2625,7 +2625,7 @@ static noinline int walk_down_log_tree(struct btrfs_trans_handle *trans, if (trans) { btrfs_tree_lock(next); - btrfs_clean_tree_block(next); + btrfs_clean_tree_block(trans, next); btrfs_wait_tree_block_writeback(next); btrfs_tree_unlock(next); ret = btrfs_pin_reserved_extent(trans, @@ -2695,7 +2695,7 @@ static noinline int walk_up_log_tree(struct btrfs_trans_handle *trans, if (trans) { btrfs_tree_lock(next); - btrfs_clean_tree_block(next); + btrfs_clean_tree_block(trans, next); btrfs_wait_tree_block_writeback(next); btrfs_tree_unlock(next); ret = btrfs_pin_reserved_extent(trans, @@ -2778,7 +2778,7 @@ static int walk_log_tree(struct btrfs_trans_handle *trans, if (trans) { btrfs_tree_lock(next); - btrfs_clean_tree_block(next); + btrfs_clean_tree_block(trans, next); btrfs_wait_tree_block_writeback(next); btrfs_tree_unlock(next); ret = btrfs_pin_reserved_extent(trans, -- cgit