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

Commit 1eae31e9 authored by Chris Mason's avatar Chris Mason
Browse files

Btrfs: make sure btrfs_remove_free_space doesn't leak EAGAIN



btrfs_remove_free_space needs to make sure to set ret back to a
valid return value after setting it to EAGAIN, otherwise we return
it to the callers.

Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent cd354ad6
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1868,6 +1868,7 @@ int btrfs_remove_free_space(struct btrfs_block_group_cache *block_group,
			ctl->total_bitmaps--;
		}
		kmem_cache_free(btrfs_free_space_cachep, info);
		ret = 0;
		goto out_lock;
	}

@@ -1875,7 +1876,8 @@ int btrfs_remove_free_space(struct btrfs_block_group_cache *block_group,
		unlink_free_space(ctl, info);
		info->offset += bytes;
		info->bytes -= bytes;
		link_free_space(ctl, info);
		ret = link_free_space(ctl, info);
		WARN_ON(ret);
		goto out_lock;
	}