From: Filipe Manana Date: Thu, 13 Nov 2025 11:46:34 +0000 (+0000) Subject: btrfs: remove duplicated leaf dirty status clearing in __push_leaf_right() X-Git-Tag: v6.19-rc1~167^2~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=29bb40ed56ab9a1418cbe3e62c97a27b48f896e2;p=thirdparty%2Fkernel%2Flinux.git btrfs: remove duplicated leaf dirty status clearing in __push_leaf_right() 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 Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba --- diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index dada50d867317..7265dd661cde1 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c @@ -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;