Skip to content

Commit 52f93e5

Browse files
josefbacikgregkh
authored andcommitted
btrfs: do not warn if we can't find the reloc root when looking up backref
commit f78743f 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>
1 parent 02785ba commit 52f93e5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/btrfs/backref.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2624,7 +2624,7 @@ static int handle_direct_tree_backref(struct btrfs_backref_cache *cache,
26242624
/* Only reloc backref cache cares about a specific root */
26252625
if (cache->is_reloc) {
26262626
root = find_reloc_root(cache->fs_info, cur->bytenr);
2627-
if (WARN_ON(!root))
2627+
if (!root)
26282628
return -ENOENT;
26292629
cur->root = root;
26302630
} else {

0 commit comments

Comments
 (0)