]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
btrfs: remove duplicated leaf dirty status clearing in __push_leaf_right()
authorFilipe Manana <fdmanana@suse.com>
Thu, 13 Nov 2025 11:46:34 +0000 (11:46 +0000)
committerDavid Sterba <dsterba@suse.com>
Mon, 24 Nov 2025 21:42:25 +0000 (22:42 +0100)
We have already called btrfs_clear_buffer_dirty() against the left leaf in
the code above:

  btrfs_set_header_nritems(left, left_nritems);

  if (left_nritems)
       btrfs_mark_buffer_dirty(trans, left);
  else
       btrfs_clear_buffer_dirty(trans, left);

So remove the second check for a 0 number of items in the left leaf and
calling again btrfs_clear_buffer_dirty() against the left leaf.

Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.c

index dada50d867317064def37a460a2d691abc17c33d..7265dd661cde1c379f118ddb4f798990f60427cc 100644 (file)
@@ -3214,8 +3214,6 @@ static noinline int __push_leaf_right(struct btrfs_trans_handle *trans,
        /* then fixup the leaf pointer in the path */
        if (path->slots[0] >= left_nritems) {
                path->slots[0] -= left_nritems;
-               if (btrfs_header_nritems(left) == 0)
-                       btrfs_clear_buffer_dirty(trans, left);
                btrfs_tree_unlock(left);
                free_extent_buffer(left);
                path->nodes[0] = right;