Skip to content

Commit

Permalink
Btrfs: fix backref walking race with tree deletions
Browse files Browse the repository at this point in the history
When a subvolume is removed, we remove the root item from the root tree,
while the tree blocks and backrefs remain for a while. When backref walking
comes across one of those orphan tree blocks, it can find a backref for a
no longer existing root. This is all good, we only must tolerate
__resolve_indirect_ref returning an error and continue with the good refs
found.

Reported-by: Alex Lyakas <alex.btrfs@zadarastorage.com>
Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
  • Loading branch information
Jan Schmidt authored and Josef Bacik committed Feb 26, 2013
1 parent f2bdf9a commit ca60ebf
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions fs/btrfs/backref.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,11 +352,8 @@ static int __resolve_indirect_refs(struct btrfs_fs_info *fs_info,
err = __resolve_indirect_ref(fs_info, search_commit_root,
time_seq, ref, parents,
extent_item_pos);
if (err) {
if (ret == 0)
ret = err;
if (err)
continue;
}

/* we put the first parent into the ref at hand */
ULIST_ITER_INIT(&uiter);
Expand Down

0 comments on commit ca60ebf

Please sign in to comment.