From: fdmanana@kernel.org
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 5/8] btrfs: remove duplicated leaf dirty status clearing in __push_leaf_right()
Date: Thu, 13 Nov 2025 16:56:36 +0000 [thread overview]
Message-ID: <94699d0ed6ed7dd70cb2df2b53bdabcb1b81043a.1763052647.git.fdmanana@suse.com> (raw)
In-Reply-To: <cover.1763052647.git.fdmanana@suse.com>
From: Filipe Manana <fdmanana@suse.com>
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.
Signed-off-by: Filipe Manana <fdmanana@suse.com>
---
fs/btrfs/ctree.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
index dada50d86731..7265dd661cde 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;
--
2.47.2
next prev parent reply other threads:[~2025-11-13 16:56 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-13 16:56 [PATCH 0/8] btrfs: a bug fix and some cleanups in ctree.c fdmanana
2025-11-13 16:56 ` [PATCH 1/8] btrfs: fix leaf leak in an error path in btrfs_del_items() fdmanana
2025-11-13 16:56 ` [PATCH 2/8] btrfs: remove pointless return value update " fdmanana
2025-11-13 16:56 ` [PATCH 3/8] btrfs: add unlikely to critical error in btrfs_extend_item() fdmanana
2025-11-13 16:56 ` [PATCH 4/8] btrfs: always use left leaf variable in __push_leaf_right() fdmanana
2025-11-13 16:56 ` fdmanana [this message]
2025-11-13 16:56 ` [PATCH 6/8] btrfs: always use right leaf variable in __push_leaf_left() fdmanana
2025-11-13 16:56 ` [PATCH 7/8] btrfs: abort transaction on item count overflow " fdmanana
2025-11-13 16:56 ` [PATCH 8/8] btrfs: update check_skip variable after unlocking current node fdmanana
2025-11-13 21:56 ` [PATCH 0/8] btrfs: a bug fix and some cleanups in ctree.c Qu Wenruo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=94699d0ed6ed7dd70cb2df2b53bdabcb1b81043a.1763052647.git.fdmanana@suse.com \
--to=fdmanana@kernel.org \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox