We should update device->bytes_used in the lock context of
chunk_mutex, or we would get wrong data.
Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Chris Mason <clm@fb.com>
if (ret)
goto error_del_extent;
+ for (i = 0; i < map->num_stripes; i++)
+ map->stripes[i].dev->bytes_used += stripe_size;
+
free_extent_map(em);
check_raid56_incompat_flag(extent_root->fs_info, type);
device = map->stripes[i].dev;
dev_offset = map->stripes[i].physical;
- device->bytes_used += stripe_size;
ret = btrfs_update_device(trans, device);
if (ret)
goto out;