aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2021-01-14 14:02:44 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-03-04 11:38:29 +0100
commit52f93e5ee700c24cf82db18bf8a78bf9666191c3 (patch)
tree4a2893dacd109bb52bfdb32375f8854e36fd5b3b
parent02785bae77ca9903dd2534a532b041d9730cbc56 (diff)
downloadkernel_replicant_linux-52f93e5ee700c24cf82db18bf8a78bf9666191c3.tar.gz
kernel_replicant_linux-52f93e5ee700c24cf82db18bf8a78bf9666191c3.tar.bz2
kernel_replicant_linux-52f93e5ee700c24cf82db18bf8a78bf9666191c3.zip
btrfs: do not warn if we can't find the reloc root when looking up backref
commit f78743fbdae1bb31bc9c9233c3590a5048782381 upstream. The backref code is looking for a reloc_root that corresponds to the given fs root. However any number of things could have gone wrong while initializing that reloc_root, like ENOMEM while trying to allocate the root itself, or EIO while trying to write the root item. This would result in no corresponding reloc_root being in the reloc root cache, and thus would return NULL when we do the find_reloc_root() call. Because of this we do not want to WARN_ON(). This presumably was meant to catch developer errors, cases where we messed up adding the reloc root. However we can easily hit this case with error injection, and thus should not do a WARN_ON(). CC: stable@vger.kernel.org # 5.10+ Reported-by: Zygo Blaxell <ce3g8jdj@umail.furryterror.org> 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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--fs/btrfs/backref.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c
index 7b56a5769d72..6e447bdaf9ec 100644
--- a/fs/btrfs/backref.c
+++ b/fs/btrfs/backref.c
@@ -2624,7 +2624,7 @@ static int handle_direct_tree_backref(struct btrfs_backref_cache *cache,
/* Only reloc backref cache cares about a specific root */
if (cache->is_reloc) {
root = find_reloc_root(cache->fs_info, cur->bytenr);
- if (WARN_ON(!root))
+ if (!root)
return -ENOENT;
cur->root = root;
} else {