Skip to content

Commit

Permalink
Btrfs: fix to catch all errors when resolving indirect ref
Browse files Browse the repository at this point in the history
We can only tolerate ENOENT here, for other errors, we should
return directly.

Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Chris Mason <clm@fb.com>
  • Loading branch information
Wang Shilong authored and Chris Mason committed Jan 29, 2014
1 parent 538f72c commit 95def2e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions fs/btrfs/backref.c
Original file line number Diff line number Diff line change
Expand Up @@ -388,10 +388,16 @@ static int __resolve_indirect_refs(struct btrfs_fs_info *fs_info,
continue;
err = __resolve_indirect_ref(fs_info, path, time_seq, ref,
parents, extent_item_pos);
if (err == -ENOMEM)
goto out;
if (err)
/*
* we can only tolerate ENOENT,otherwise,we should catch error
* and return directly.
*/
if (err == -ENOENT) {
continue;
} else if (err) {
ret = err;
goto out;
}

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

0 comments on commit 95def2e

Please sign in to comment.