]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
btrfs: do not warn for free space inode in cow_file_range
authorJosef Bacik <josef@toxicpanda.com>
Wed, 23 Mar 2022 15:30:36 +0000 (11:30 -0400)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 27 Apr 2022 10:00:53 +0000 (12:00 +0200)
commit8494a17cc8ef9f0c49df6f12cc0cfcd4d0763bee
treec2276b57041740095f81f20cb466c0ce0fab8a40
parent029e93c8a089d7c430b7e8bdf3a989b2e9e90e2f
btrfs: do not warn for free space inode in cow_file_range

BugLink: https://bugs.launchpad.net/bugs/1969857
[ Upstream commit a7d16d9a07bbcb7dcd5214a1bea75c808830bc0d ]

This is a long time leftover from when I originally added the free space
inode, the point was to catch cases where we weren't honoring the NOCOW
flag.  However there exists a race with relocation, if we allocate our
free space inode in a block group that is about to be relocated, we
could trigger the COW path before the relocation has the opportunity to
find the extents and delete the free space cache.  In production where
we have auto-relocation enabled we're seeing this WARN_ON_ONCE() around
5k times in a 2 week period, so not super common but enough that it's at
the top of our metrics.

We're properly handling the error here, and with us phasing out v1 space
cache anyway just drop the WARN_ON_ONCE.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
fs/btrfs/inode.c