]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit - fs/btrfs/ctree.c
btrfs: use BTRFS_NESTED_NEW_ROOT for double splits
authorJosef Bacik <josef@toxicpanda.com>
Thu, 20 Aug 2020 15:46:08 +0000 (11:46 -0400)
committerDavid Sterba <dsterba@suse.com>
Wed, 7 Oct 2020 10:12:17 +0000 (12:12 +0200)
commitca9d473a3e300bcddc73c00fdf2f4bf6ca43c4a2
treece8598f6b0a01f7fc44e7d495dba46011b2dd8d6
parentcf6f34aa3ada0be8c5f90fe93f48a75fea082c51
btrfs: use BTRFS_NESTED_NEW_ROOT for double splits

I've made this change separate since it requires both of the newly added
NESTED flags and I didn't want to slip it into one of those changes.

If we do a double split of a node we can end up doing a
BTRFS_NESTED_SPLIT on level 0, which throws lockdep off because it
appears as a double lock.  Since we're maxed out on subclasses, use
BTRFS_NESTED_NEW_ROOT if we had to do a double split.  This is OK
because we won't have to do a double split if we had to insert a new
root, and the new root would be at a higher level anyway.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.c