diff options
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r-- | fs/btrfs/volumes.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index bcd14ebccae1..dd06e18e5aac 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
@@ -1374,6 +1374,12 @@ int btrfs_init_new_device(struct btrfs_root *root, char *device_path) | |||
1374 | ret = btrfs_add_device(trans, root, device); | 1374 | ret = btrfs_add_device(trans, root, device); |
1375 | } | 1375 | } |
1376 | 1376 | ||
1377 | /* | ||
1378 | * we've got more storage, clear any full flags on the space | ||
1379 | * infos | ||
1380 | */ | ||
1381 | btrfs_clear_space_info_full(root->fs_info); | ||
1382 | |||
1377 | unlock_chunks(root); | 1383 | unlock_chunks(root); |
1378 | btrfs_commit_transaction(trans, root); | 1384 | btrfs_commit_transaction(trans, root); |
1379 | 1385 | ||
@@ -1459,6 +1465,8 @@ static int __btrfs_grow_device(struct btrfs_trans_handle *trans, | |||
1459 | device->fs_devices->total_rw_bytes += diff; | 1465 | device->fs_devices->total_rw_bytes += diff; |
1460 | 1466 | ||
1461 | device->total_bytes = new_size; | 1467 | device->total_bytes = new_size; |
1468 | btrfs_clear_space_info_full(device->dev_root->fs_info); | ||
1469 | |||
1462 | return btrfs_update_device(trans, device); | 1470 | return btrfs_update_device(trans, device); |
1463 | } | 1471 | } |
1464 | 1472 | ||
@@ -2894,10 +2902,6 @@ static int read_one_chunk(struct btrfs_root *root, struct btrfs_key *key, | |||
2894 | free_extent_map(em); | 2902 | free_extent_map(em); |
2895 | } | 2903 | } |
2896 | 2904 | ||
2897 | map = kzalloc(sizeof(*map), GFP_NOFS); | ||
2898 | if (!map) | ||
2899 | return -ENOMEM; | ||
2900 | |||
2901 | em = alloc_extent_map(GFP_NOFS); | 2905 | em = alloc_extent_map(GFP_NOFS); |
2902 | if (!em) | 2906 | if (!em) |
2903 | return -ENOMEM; | 2907 | return -ENOMEM; |
@@ -3106,6 +3110,8 @@ int btrfs_read_sys_array(struct btrfs_root *root) | |||
3106 | if (!sb) | 3110 | if (!sb) |
3107 | return -ENOMEM; | 3111 | return -ENOMEM; |
3108 | btrfs_set_buffer_uptodate(sb); | 3112 | btrfs_set_buffer_uptodate(sb); |
3113 | btrfs_set_buffer_lockdep_class(sb, 0); | ||
3114 | |||
3109 | write_extent_buffer(sb, super_copy, 0, BTRFS_SUPER_INFO_SIZE); | 3115 | write_extent_buffer(sb, super_copy, 0, BTRFS_SUPER_INFO_SIZE); |
3110 | array_size = btrfs_super_sys_array_size(super_copy); | 3116 | array_size = btrfs_super_sys_array_size(super_copy); |
3111 | 3117 | ||