Btrfs: limit the global reserve to 512mb
[pandora-kernel.git] / fs / btrfs / extent-tree.c
index f5fbe57..8d4d53d 100644 (file)
@@ -3996,7 +3996,7 @@ static void update_global_block_rsv(struct btrfs_fs_info *fs_info)
        spin_lock(&block_rsv->lock);
        spin_lock(&sinfo->lock);
 
-       block_rsv->size = num_bytes;
+       block_rsv->size = min_t(u64, num_bytes, 512 * 1024 * 1024);
 
        num_bytes = sinfo->bytes_used + sinfo->bytes_pinned +
                    sinfo->bytes_reserved + sinfo->bytes_readonly +