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

Commit 75c195a2 authored by Chris Mason's avatar Chris Mason
Browse files

Btrfs: make sure reserve_metadata_bytes doesn't leak out strange errors



The btrfs transaction code will return any errors that come from
reserve_metadata_bytes.  We need to make sure we don't return funny
things like 1 or EAGAIN.

Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent 2cf8572d
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -3474,6 +3474,8 @@ again:
	if (ret < 0)
		goto out;

	ret = 0;

	/*
	 * So if we were overcommitted it's possible that somebody else flushed
	 * out enough space and we simply didn't have enough space to reclaim,
@@ -3496,10 +3498,13 @@ again:
		goto out;

	ret = -EAGAIN;
	if (trans || committed)
	if (trans)
		goto out;

	ret = -ENOSPC;
	if (committed)
		goto out;

	trans = btrfs_join_transaction(root);
	if (IS_ERR(trans))
		goto out;