]> Gentwo Git Trees - linux/.git/commit
btrfs: simplify leaf traversal after path release in btrfs_next_old_leaf()
authorSun YangKai <sunk67188@gmail.com>
Fri, 14 Nov 2025 07:24:47 +0000 (15:24 +0800)
committerDavid Sterba <dsterba@suse.com>
Tue, 25 Nov 2025 00:50:56 +0000 (01:50 +0100)
commit139f75a3b1677c76bd845228ec49e50d69ce556e
tree76425b5295a02de479fb1731fb5d9f55f5b5ea61
parent3afa17bf243cf384e8caa64e1e3fad8b543c7c83
btrfs: simplify leaf traversal after path release in btrfs_next_old_leaf()

After releasing the path in btrfs_next_old_leaf(), we need to re-check
the leaf because a balance operation may have added items or removed the
last item. The original code handled this with two separate conditional
blocks, the second marked with a lengthy comment explaining a "missed
case".

Merge these two blocks into a single logical structure that handles both
scenarios more clearly.

Also update the comment to be more concise and accurate, incorporating the
explanation directly into the main block rather than a separate annotation.

Signed-off-by: Sun YangKai <sunk67188@gmail.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.c