From: Chris Mason Date: Fri, 14 Oct 2011 10:31:20 +0000 (-0400) Subject: Btrfs: make sure btrfs_remove_free_space doesn't leak EAGAIN X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1eae31e918972bbeefc119d23c1d67674f49a301;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git 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: Chris Mason --- diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c index de205d59b74b..f49475dfa954 100644 --- a/fs/btrfs/free-space-cache.c +++ b/fs/btrfs/free-space-cache.c @@ -1868,6 +1868,7 @@ again: ctl->total_bitmaps--; } kmem_cache_free(btrfs_free_space_cachep, info); + ret = 0; goto out_lock; } @@ -1875,7 +1876,8 @@ again: 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; }