Skip to content

Commit

Permalink
Btrfs: make sure btrfs_remove_free_space doesn't leak EAGAIN
Browse files Browse the repository at this point in the history
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 <chris.mason@oracle.com>
  • Loading branch information
Chris Mason committed Nov 6, 2011
1 parent cd354ad commit 1eae31e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/btrfs/free-space-cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -1868,14 +1868,16 @@ 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;
}

if (!info->bitmap && info->offset == offset) {
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;
}

Expand Down

0 comments on commit 1eae31e

Please sign in to comment.