btrfs: initialize fs_info::csum_size earlier in open_ctree
[sfrench/cifs-2.6.git] / fs / btrfs / disk-io.c
index 6b35b7e8813697e59c3e97b27e4c952a8973edfd..07a2b4f69b10e31f0f3119828b2fd339d497aa2c 100644 (file)
@@ -3044,6 +3044,8 @@ int __cold open_ctree(struct super_block *sb, struct btrfs_fs_devices *fs_device
                goto fail_alloc;
        }
 
+       fs_info->csum_size = btrfs_super_csum_size(disk_super);
+
        ret = btrfs_init_csum_hash(fs_info, csum_type);
        if (ret) {
                err = ret;
@@ -3161,7 +3163,6 @@ int __cold open_ctree(struct super_block *sb, struct btrfs_fs_devices *fs_device
        fs_info->nodesize = nodesize;
        fs_info->sectorsize = sectorsize;
        fs_info->sectorsize_bits = ilog2(sectorsize);
-       fs_info->csum_size = btrfs_super_csum_size(disk_super);
        fs_info->csums_per_leaf = BTRFS_MAX_ITEM_SIZE(fs_info) / fs_info->csum_size;
        fs_info->stripesize = stripesize;