diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index a541bc87f04c81c1d3d612131e0fdbb14ab22115..ddaf6340fe7f75017a463cc78ae2314b597747d6 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -3413,7 +3413,7 @@ static int reserve_metadata_bytes(struct btrfs_trans_handle *trans, * 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;