btrfs: always lock the block before calling btrfs_clean_tree_block
authorJosef Bacik <josef@toxicpanda.com>
Thu, 26 Jan 2023 21:00:54 +0000 (16:00 -0500)
committerDavid Sterba <dsterba@suse.com>
Wed, 15 Feb 2023 18:38:53 +0000 (19:38 +0100)
We want to clean up the dirty handling for extent buffers so it's a
little more consistent, so skip the check for generation == transid and
simply always lock the extent buffer before calling btrfs_clean_tree_block.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent-tree.c

index 688cdf8..97f2c10 100644 (file)
@@ -5469,8 +5469,7 @@ static noinline int walk_up_proc(struct btrfs_trans_handle *trans,
                        }
                }
                /* make block locked assertion in btrfs_clean_tree_block happy */
-               if (!path->locks[level] &&
-                   btrfs_header_generation(eb) == trans->transid) {
+               if (!path->locks[level]) {
                        btrfs_tree_lock(eb);
                        path->locks[level] = BTRFS_WRITE_LOCK;
                }