diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index a073f3ece43a62d6e57f12bb94a9948edeed83c2..277d2c26b03438d6894b60bedc8da9836dd9d6f5 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -3836,8 +3836,12 @@ static int do_chunk_alloc(struct btrfs_trans_handle *trans, if (force < space_info->force_alloc) force = space_info->force_alloc; if (space_info->full) { + if (should_alloc_chunk(extent_root, space_info, force)) + ret = -ENOSPC; + else + ret = 0; spin_unlock(&space_info->lock); - return 0; + return ret; } if (!should_alloc_chunk(extent_root, space_info, force)) {