]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: load the free space cache inode extents from commit root
authorJosef Bacik <josef@toxicpanda.com>
Fri, 23 Oct 2020 13:58:09 +0000 (09:58 -0400)
committerDavid Sterba <dsterba@suse.com>
Tue, 8 Dec 2020 14:54:03 +0000 (15:54 +0100)
commitafa227767f9caa5b3680fb79ec8c98e7753d3408
tree7f867f97e2dcb9d48d688da50f34e80d51bdc139
parent25ade0fd2906ee518ed2acb09dcb16bb4744cd9f
btrfs: load the free space cache inode extents from commit root

Historically we've allowed recursive locking specifically for the free
space inode.  This is because we are only doing reads and know that it's
safe.  However we don't actually need this feature, we can get away with
reading the commit root for the extents.  In fact if we want to allow
asynchronous loading of the free space cache we have to use the commit
root, otherwise we will deadlock.

Switch to using the commit root for the file extents.  These are only
read at load time, and are replaced as soon as we start writing the
cache out to disk.  The cache is never read again, so this is
legitimate.  This matches what we do for the inode itself, as we read
that from the commit root as well.

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