On Sat, Nov 13, 2010 at 12:17:56AM +0100, Arne Jansen
wrote:> ''unused'' calculated with wrong sign in
reserve_metadata_bytes().
> This might have lead to unwanted over-reservations.
>
> Signed-off-by: Arne Jansen <sensille@gmx.net>
> ---
> fs/btrfs/extent-tree.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
> index a541bc8..ddaf634 100644
> --- a/fs/btrfs/extent-tree.c
> +++ b/fs/btrfs/extent-tree.c
> @@ -3413,7 +3413,7 @@ again:
> * our reservation.
> */
> if (unused <= space_info->total_bytes) {
> - unused -= space_info->total_bytes;
> + unused = space_info->total_bytes - unused;
> if (unused >= num_bytes) {
> if (!reserved)
> space_info->bytes_reserved += orig_bytes;
> --
> 1.7.2.2
>
Good catch
Reviewed-by: Josef Bacik <josef@redhat.com>
Thanks,
Josef
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs"
in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html