File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -588,16 +588,15 @@ static int update_block_group(struct btrfs_trans_handle *trans,
588
588
old_val < (cache -> key .offset >> 1 )) {
589
589
int bit_to_clear ;
590
590
int bit_to_set ;
591
-
592
591
cache -> data = data ;
593
592
if (data ) {
594
- bit_to_clear = BLOCK_GROUP_DATA ;
595
- bit_to_set = BLOCK_GROUP_METADATA ;
593
+ bit_to_clear = BLOCK_GROUP_METADATA ;
594
+ bit_to_set = BLOCK_GROUP_DATA ;
596
595
cache -> item .flags |=
597
596
BTRFS_BLOCK_GROUP_DATA ;
598
597
} else {
599
- bit_to_clear = BLOCK_GROUP_METADATA ;
600
- bit_to_set = BLOCK_GROUP_DATA ;
598
+ bit_to_clear = BLOCK_GROUP_DATA ;
599
+ bit_to_set = BLOCK_GROUP_METADATA ;
601
600
cache -> item .flags &=
602
601
~BTRFS_BLOCK_GROUP_DATA ;
603
602
}
@@ -1459,13 +1458,16 @@ int btrfs_free_block_groups(struct btrfs_fs_info *info)
1459
1458
{
1460
1459
u64 start ;
1461
1460
u64 end ;
1461
+ u64 ptr ;
1462
1462
int ret ;
1463
-
1464
1463
while (1 ) {
1465
1464
ret = find_first_extent_bit (& info -> block_group_cache , 0 ,
1466
1465
& start , & end , (unsigned int )-1 );
1467
1466
if (ret )
1468
1467
break ;
1468
+ ret = get_state_private (& info -> block_group_cache , start , & ptr );
1469
+ if (!ret )
1470
+ kfree ((void * )(unsigned long )ptr );
1469
1471
clear_extent_bits (& info -> block_group_cache , start ,
1470
1472
end , (unsigned int )-1 , GFP_NOFS );
1471
1473
}
You can’t perform that action at this time.
0 commit comments