]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
btrfs: update check_skip variable after unlocking current node
authorFilipe Manana <fdmanana@suse.com>
Thu, 13 Nov 2025 12:07:14 +0000 (12:07 +0000)
committerDavid Sterba <dsterba@suse.com>
Mon, 24 Nov 2025 21:42:25 +0000 (22:42 +0100)
There's no need to update the local variable 'check_skip' to false inside
the critical section delimited by the lock of the current node, so do it
after unlocking the node.

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 8b54daf3d0e71d27ce936738a56b392521a8eb25..46262939e873cdc3812bfb9e7f33ae5aa1052ef0 100644 (file)
@@ -1435,8 +1435,8 @@ static noinline void unlock_up(struct btrfs_path *path, int level,
                }
 
                if (i >= lowest_unlock && i > skip_level) {
-                       check_skip = false;
                        btrfs_tree_unlock_rw(path->nodes[i], path->locks[i]);
+                       check_skip = false;
                        path->locks[i] = 0;
                        if (write_lock_level &&
                            i > min_write_lock_level &&