Btrfs: bail out if block group has different mixed flag
authorLiu Bo <bo.li.liu@oracle.com>
Fri, 26 Aug 2016 01:08:27 +0000 (18:08 -0700)
committerDavid Sterba <dsterba@suse.com>
Tue, 6 Sep 2016 16:36:11 +0000 (18:36 +0200)
commita4a563129e8d4e132e22f87d74db7b0f0376da93
tree5b686a5888f4dced16ddd93065fa73bf5f5e62d5
parentecaf74739ae5438b958dad95838d3252d0995d8d
Btrfs: bail out if block group has different mixed flag

Currently we allow inconsistence about mixed flag
 (BTRFS_BLOCK_GROUP_METADATA | BTRFS_BLOCK_GROUP_DATA).

We'd get ENOSPC if block group has mixed flag and btrfs doesn't.
If that happens, we have one space_info with mixed flag and another
space_info only with BTRFS_BLOCK_GROUP_METADATA, and
global_block_rsv.space_info points to the latter one, but all bytes
from block_group contributes to the mixed space_info, thus all the
allocation will fail with ENOSPC.

This adds a check for the above case.

Reported-by: Vegard Nossum <vegard.nossum@oracle.com>
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
[ updated message ]
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent-tree.c
This page took 0.024185 seconds and 5 git commands to generate.