diff options
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/super.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 8bd9d6d0e07a..1a3ce9e0b495 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c | |||
@@ -1083,7 +1083,7 @@ static int btrfs_calc_avail_data_space(struct btrfs_root *root, u64 *free_bytes) | |||
1083 | int i = 0, nr_devices; | 1083 | int i = 0, nr_devices; |
1084 | int ret; | 1084 | int ret; |
1085 | 1085 | ||
1086 | nr_devices = fs_info->fs_devices->rw_devices; | 1086 | nr_devices = fs_info->fs_devices->open_devices; |
1087 | BUG_ON(!nr_devices); | 1087 | BUG_ON(!nr_devices); |
1088 | 1088 | ||
1089 | devices_info = kmalloc(sizeof(*devices_info) * nr_devices, | 1089 | devices_info = kmalloc(sizeof(*devices_info) * nr_devices, |
@@ -1105,8 +1105,8 @@ static int btrfs_calc_avail_data_space(struct btrfs_root *root, u64 *free_bytes) | |||
1105 | else | 1105 | else |
1106 | min_stripe_size = BTRFS_STRIPE_LEN; | 1106 | min_stripe_size = BTRFS_STRIPE_LEN; |
1107 | 1107 | ||
1108 | list_for_each_entry(device, &fs_devices->alloc_list, dev_alloc_list) { | 1108 | list_for_each_entry(device, &fs_devices->devices, dev_list) { |
1109 | if (!device->in_fs_metadata) | 1109 | if (!device->in_fs_metadata || !device->bdev) |
1110 | continue; | 1110 | continue; |
1111 | 1111 | ||
1112 | avail_space = device->total_bytes - device->bytes_used; | 1112 | avail_space = device->total_bytes - device->bytes_used; |