diff options
author | Jan Schmidt <list.btrfs@jan-o-sch.net> | 2013-02-21 10:35:27 -0500 |
---|---|---|
committer | Josef Bacik <jbacik@fusionio.com> | 2013-02-26 11:00:50 -0500 |
commit | ca60ebfa303ca6d9f3cad5028c10f0a17d571a4c (patch) | |
tree | c8445152a89596fb1d6895a198327268067b11ae | |
parent | f2bdf9a8f79052e9577936cbe5696c0e232aa0e3 (diff) |
Btrfs: fix backref walking race with tree deletions
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>
-rw-r--r-- | fs/btrfs/backref.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c index 04edf69be875..bd605c87adfd 100644 --- a/fs/btrfs/backref.c +++ b/fs/btrfs/backref.c | |||
@@ -352,11 +352,8 @@ static int __resolve_indirect_refs(struct btrfs_fs_info *fs_info, | |||
352 | err = __resolve_indirect_ref(fs_info, search_commit_root, | 352 | err = __resolve_indirect_ref(fs_info, search_commit_root, |
353 | time_seq, ref, parents, | 353 | time_seq, ref, parents, |
354 | extent_item_pos); | 354 | extent_item_pos); |
355 | if (err) { | 355 | if (err) |
356 | if (ret == 0) | ||
357 | ret = err; | ||
358 | continue; | 356 | continue; |
359 | } | ||
360 | 357 | ||
361 | /* we put the first parent into the ref at hand */ | 358 | /* we put the first parent into the ref at hand */ |
362 | ULIST_ITER_INIT(&uiter); | 359 | ULIST_ITER_INIT(&uiter); |