Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 95def2ed authored by Wang Shilong's avatar Wang Shilong Committed by Chris Mason
Browse files

Btrfs: fix to catch all errors when resolving indirect ref



We can only tolerate ENOENT here, for other errors, we should
return directly.

Signed-off-by: default avatarWang Shilong <wangsl.fnst@cn.fujitsu.com>
Signed-off-by: default avatarJosef Bacik <jbacik@fb.com>
Signed-off-by: default avatarChris Mason <clm@fb.com>
parent 538f72cd
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -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);