diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index d3e6a9b429dd..a7f0607a5b86 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -3019,6 +3019,10 @@ int btrfs_init_new_device(struct btrfs_fs_info *fs_info, const char *device_path if (ret) goto error_free_device; + ret = set_blocksize(device->bdev_file, BTRFS_BDEV_BLOCKSIZE); + if (ret) + goto error_free_zone; + trans = btrfs_start_transaction(root, 0); if (IS_ERR(trans)) { ret = PTR_ERR(trans); @@ -3043,7 +3047,6 @@ int btrfs_init_new_device(struct btrfs_fs_info *fs_info, const char *device_path */ atomic_inc(&device->dev_stats_ccnt); device->dev_stats_valid = 1; - set_blocksize(device->bdev_file, BTRFS_BDEV_BLOCKSIZE); if (seeding_dev) { /* GFP_KERNEL allocation must not be under device_list_mutex */