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

Commit dedefd72 authored by Josef Bacik's avatar Josef Bacik Committed by Chris Mason
Browse files

Btrfs: fix check_path_shared so it returns the right value



When running xfstests 224 I kept getting ENOSPC when trying to remove the files,
and this is because we were returning ret from check_path_shared while it was
uninitalized, which isn't right.  Fix this to return 0 properly, and now
xfstests 224 doesn't freak out when it tries to clean itself up.  Thanks,

Signed-off-by: default avatarJosef Bacik <josef@redhat.com>
Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent abd30bb0
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -2718,9 +2718,10 @@ static int check_path_shared(struct btrfs_root *root,
	struct extent_buffer *eb;
	struct extent_buffer *eb;
	int level;
	int level;
	u64 refs = 1;
	u64 refs = 1;
	int uninitialized_var(ret);


	for (level = 0; level < BTRFS_MAX_LEVEL; level++) {
	for (level = 0; level < BTRFS_MAX_LEVEL; level++) {
		int ret;

		if (!path->nodes[level])
		if (!path->nodes[level])
			break;
			break;
		eb = path->nodes[level];
		eb = path->nodes[level];
@@ -2731,7 +2732,7 @@ static int check_path_shared(struct btrfs_root *root,
		if (refs > 1)
		if (refs > 1)
			return 1;
			return 1;
	}
	}
	return ret; /* XXX callers? */
	return 0;
}
}


/*
/*