diff options
author | David Sterba <dsterba@suse.com> | 2016-05-16 09:46:24 -0400 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2016-05-16 09:46:24 -0400 |
commit | 5ef64a3e757c94b2f2fc61465ef9603aaacaecff (patch) | |
tree | 5f8da3043723e98e8313ebf180fe84a9a12b8db0 /fs/btrfs/disk-io.c | |
parent | 73d32ce21e1701eaafcea3cbc2a8f27ab1967abe (diff) | |
parent | e1860a7724828a341037b010b3f4ff58bad53f95 (diff) |
Merge branch 'cleanups-4.7' into for-chris-4.7-20160516
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r-- | fs/btrfs/disk-io.c | 112 |
1 files changed, 55 insertions, 57 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 070c1dad42bd..91d123938cef 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -1640,7 +1640,7 @@ int btrfs_insert_fs_root(struct btrfs_fs_info *fs_info, | |||
1640 | { | 1640 | { |
1641 | int ret; | 1641 | int ret; |
1642 | 1642 | ||
1643 | ret = radix_tree_preload(GFP_NOFS & ~__GFP_HIGHMEM); | 1643 | ret = radix_tree_preload(GFP_NOFS); |
1644 | if (ret) | 1644 | if (ret) |
1645 | return ret; | 1645 | return ret; |
1646 | 1646 | ||
@@ -2417,7 +2417,7 @@ static int btrfs_replay_log(struct btrfs_fs_info *fs_info, | |||
2417 | /* returns with log_tree_root freed on success */ | 2417 | /* returns with log_tree_root freed on success */ |
2418 | ret = btrfs_recover_log_trees(log_tree_root); | 2418 | ret = btrfs_recover_log_trees(log_tree_root); |
2419 | if (ret) { | 2419 | if (ret) { |
2420 | btrfs_std_error(tree_root->fs_info, ret, | 2420 | btrfs_handle_fs_error(tree_root->fs_info, ret, |
2421 | "Failed to recover log tree"); | 2421 | "Failed to recover log tree"); |
2422 | free_extent_buffer(log_tree_root->node); | 2422 | free_extent_buffer(log_tree_root->node); |
2423 | kfree(log_tree_root); | 2423 | kfree(log_tree_root); |
@@ -2714,7 +2714,7 @@ int open_ctree(struct super_block *sb, | |||
2714 | * Pass the whole disk block of size BTRFS_SUPER_INFO_SIZE (4k). | 2714 | * Pass the whole disk block of size BTRFS_SUPER_INFO_SIZE (4k). |
2715 | */ | 2715 | */ |
2716 | if (btrfs_check_super_csum(bh->b_data)) { | 2716 | if (btrfs_check_super_csum(bh->b_data)) { |
2717 | printk(KERN_ERR "BTRFS: superblock checksum mismatch\n"); | 2717 | btrfs_err(fs_info, "superblock checksum mismatch"); |
2718 | err = -EINVAL; | 2718 | err = -EINVAL; |
2719 | brelse(bh); | 2719 | brelse(bh); |
2720 | goto fail_alloc; | 2720 | goto fail_alloc; |
@@ -2734,7 +2734,7 @@ int open_ctree(struct super_block *sb, | |||
2734 | 2734 | ||
2735 | ret = btrfs_check_super_valid(fs_info, sb->s_flags & MS_RDONLY); | 2735 | ret = btrfs_check_super_valid(fs_info, sb->s_flags & MS_RDONLY); |
2736 | if (ret) { | 2736 | if (ret) { |
2737 | printk(KERN_ERR "BTRFS: superblock contains fatal errors\n"); | 2737 | btrfs_err(fs_info, "superblock contains fatal errors"); |
2738 | err = -EINVAL; | 2738 | err = -EINVAL; |
2739 | goto fail_alloc; | 2739 | goto fail_alloc; |
2740 | } | 2740 | } |
@@ -2769,9 +2769,9 @@ int open_ctree(struct super_block *sb, | |||
2769 | features = btrfs_super_incompat_flags(disk_super) & | 2769 | features = btrfs_super_incompat_flags(disk_super) & |
2770 | ~BTRFS_FEATURE_INCOMPAT_SUPP; | 2770 | ~BTRFS_FEATURE_INCOMPAT_SUPP; |
2771 | if (features) { | 2771 | if (features) { |
2772 | printk(KERN_ERR "BTRFS: couldn't mount because of " | 2772 | btrfs_err(fs_info, |
2773 | "unsupported optional features (%Lx).\n", | 2773 | "cannot mount because of unsupported optional features (%llx)", |
2774 | features); | 2774 | features); |
2775 | err = -EINVAL; | 2775 | err = -EINVAL; |
2776 | goto fail_alloc; | 2776 | goto fail_alloc; |
2777 | } | 2777 | } |
@@ -2782,7 +2782,7 @@ int open_ctree(struct super_block *sb, | |||
2782 | features |= BTRFS_FEATURE_INCOMPAT_COMPRESS_LZO; | 2782 | features |= BTRFS_FEATURE_INCOMPAT_COMPRESS_LZO; |
2783 | 2783 | ||
2784 | if (features & BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA) | 2784 | if (features & BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA) |
2785 | printk(KERN_INFO "BTRFS: has skinny extents\n"); | 2785 | btrfs_info(fs_info, "has skinny extents"); |
2786 | 2786 | ||
2787 | /* | 2787 | /* |
2788 | * flag our filesystem as having big metadata blocks if | 2788 | * flag our filesystem as having big metadata blocks if |
@@ -2790,7 +2790,8 @@ int open_ctree(struct super_block *sb, | |||
2790 | */ | 2790 | */ |
2791 | if (btrfs_super_nodesize(disk_super) > PAGE_SIZE) { | 2791 | if (btrfs_super_nodesize(disk_super) > PAGE_SIZE) { |
2792 | if (!(features & BTRFS_FEATURE_INCOMPAT_BIG_METADATA)) | 2792 | if (!(features & BTRFS_FEATURE_INCOMPAT_BIG_METADATA)) |
2793 | printk(KERN_INFO "BTRFS: flagging fs with big metadata feature\n"); | 2793 | btrfs_info(fs_info, |
2794 | "flagging fs with big metadata feature"); | ||
2794 | features |= BTRFS_FEATURE_INCOMPAT_BIG_METADATA; | 2795 | features |= BTRFS_FEATURE_INCOMPAT_BIG_METADATA; |
2795 | } | 2796 | } |
2796 | 2797 | ||
@@ -2806,9 +2807,9 @@ int open_ctree(struct super_block *sb, | |||
2806 | */ | 2807 | */ |
2807 | if ((features & BTRFS_FEATURE_INCOMPAT_MIXED_GROUPS) && | 2808 | if ((features & BTRFS_FEATURE_INCOMPAT_MIXED_GROUPS) && |
2808 | (sectorsize != nodesize)) { | 2809 | (sectorsize != nodesize)) { |
2809 | printk(KERN_ERR "BTRFS: unequal leaf/node/sector sizes " | 2810 | btrfs_err(fs_info, |
2810 | "are not allowed for mixed block groups on %s\n", | 2811 | "unequal nodesize/sectorsize (%u != %u) are not allowed for mixed block groups", |
2811 | sb->s_id); | 2812 | nodesize, sectorsize); |
2812 | goto fail_alloc; | 2813 | goto fail_alloc; |
2813 | } | 2814 | } |
2814 | 2815 | ||
@@ -2821,8 +2822,8 @@ int open_ctree(struct super_block *sb, | |||
2821 | features = btrfs_super_compat_ro_flags(disk_super) & | 2822 | features = btrfs_super_compat_ro_flags(disk_super) & |
2822 | ~BTRFS_FEATURE_COMPAT_RO_SUPP; | 2823 | ~BTRFS_FEATURE_COMPAT_RO_SUPP; |
2823 | if (!(sb->s_flags & MS_RDONLY) && features) { | 2824 | if (!(sb->s_flags & MS_RDONLY) && features) { |
2824 | printk(KERN_ERR "BTRFS: couldn't mount RDWR because of " | 2825 | btrfs_err(fs_info, |
2825 | "unsupported option features (%Lx).\n", | 2826 | "cannot mount read-write because of unsupported optional features (%llx)", |
2826 | features); | 2827 | features); |
2827 | err = -EINVAL; | 2828 | err = -EINVAL; |
2828 | goto fail_alloc; | 2829 | goto fail_alloc; |
@@ -2851,8 +2852,7 @@ int open_ctree(struct super_block *sb, | |||
2851 | ret = btrfs_read_sys_array(tree_root); | 2852 | ret = btrfs_read_sys_array(tree_root); |
2852 | mutex_unlock(&fs_info->chunk_mutex); | 2853 | mutex_unlock(&fs_info->chunk_mutex); |
2853 | if (ret) { | 2854 | if (ret) { |
2854 | printk(KERN_ERR "BTRFS: failed to read the system " | 2855 | btrfs_err(fs_info, "failed to read the system array: %d", ret); |
2855 | "array on %s\n", sb->s_id); | ||
2856 | goto fail_sb_buffer; | 2856 | goto fail_sb_buffer; |
2857 | } | 2857 | } |
2858 | 2858 | ||
@@ -2866,8 +2866,7 @@ int open_ctree(struct super_block *sb, | |||
2866 | generation); | 2866 | generation); |
2867 | if (IS_ERR(chunk_root->node) || | 2867 | if (IS_ERR(chunk_root->node) || |
2868 | !extent_buffer_uptodate(chunk_root->node)) { | 2868 | !extent_buffer_uptodate(chunk_root->node)) { |
2869 | printk(KERN_ERR "BTRFS: failed to read chunk root on %s\n", | 2869 | btrfs_err(fs_info, "failed to read chunk root"); |
2870 | sb->s_id); | ||
2871 | if (!IS_ERR(chunk_root->node)) | 2870 | if (!IS_ERR(chunk_root->node)) |
2872 | free_extent_buffer(chunk_root->node); | 2871 | free_extent_buffer(chunk_root->node); |
2873 | chunk_root->node = NULL; | 2872 | chunk_root->node = NULL; |
@@ -2881,8 +2880,7 @@ int open_ctree(struct super_block *sb, | |||
2881 | 2880 | ||
2882 | ret = btrfs_read_chunk_tree(chunk_root); | 2881 | ret = btrfs_read_chunk_tree(chunk_root); |
2883 | if (ret) { | 2882 | if (ret) { |
2884 | printk(KERN_ERR "BTRFS: failed to read chunk tree on %s\n", | 2883 | btrfs_err(fs_info, "failed to read chunk tree: %d", ret); |
2885 | sb->s_id); | ||
2886 | goto fail_tree_roots; | 2884 | goto fail_tree_roots; |
2887 | } | 2885 | } |
2888 | 2886 | ||
@@ -2893,8 +2891,7 @@ int open_ctree(struct super_block *sb, | |||
2893 | btrfs_close_extra_devices(fs_devices, 0); | 2891 | btrfs_close_extra_devices(fs_devices, 0); |
2894 | 2892 | ||
2895 | if (!fs_devices->latest_bdev) { | 2893 | if (!fs_devices->latest_bdev) { |
2896 | printk(KERN_ERR "BTRFS: failed to read devices on %s\n", | 2894 | btrfs_err(fs_info, "failed to read devices"); |
2897 | sb->s_id); | ||
2898 | goto fail_tree_roots; | 2895 | goto fail_tree_roots; |
2899 | } | 2896 | } |
2900 | 2897 | ||
@@ -2906,8 +2903,7 @@ retry_root_backup: | |||
2906 | generation); | 2903 | generation); |
2907 | if (IS_ERR(tree_root->node) || | 2904 | if (IS_ERR(tree_root->node) || |
2908 | !extent_buffer_uptodate(tree_root->node)) { | 2905 | !extent_buffer_uptodate(tree_root->node)) { |
2909 | printk(KERN_WARNING "BTRFS: failed to read tree root on %s\n", | 2906 | btrfs_warn(fs_info, "failed to read tree root"); |
2910 | sb->s_id); | ||
2911 | if (!IS_ERR(tree_root->node)) | 2907 | if (!IS_ERR(tree_root->node)) |
2912 | free_extent_buffer(tree_root->node); | 2908 | free_extent_buffer(tree_root->node); |
2913 | tree_root->node = NULL; | 2909 | tree_root->node = NULL; |
@@ -2939,20 +2935,19 @@ retry_root_backup: | |||
2939 | 2935 | ||
2940 | ret = btrfs_recover_balance(fs_info); | 2936 | ret = btrfs_recover_balance(fs_info); |
2941 | if (ret) { | 2937 | if (ret) { |
2942 | printk(KERN_ERR "BTRFS: failed to recover balance\n"); | 2938 | btrfs_err(fs_info, "failed to recover balance: %d", ret); |
2943 | goto fail_block_groups; | 2939 | goto fail_block_groups; |
2944 | } | 2940 | } |
2945 | 2941 | ||
2946 | ret = btrfs_init_dev_stats(fs_info); | 2942 | ret = btrfs_init_dev_stats(fs_info); |
2947 | if (ret) { | 2943 | if (ret) { |
2948 | printk(KERN_ERR "BTRFS: failed to init dev_stats: %d\n", | 2944 | btrfs_err(fs_info, "failed to init dev_stats: %d", ret); |
2949 | ret); | ||
2950 | goto fail_block_groups; | 2945 | goto fail_block_groups; |
2951 | } | 2946 | } |
2952 | 2947 | ||
2953 | ret = btrfs_init_dev_replace(fs_info); | 2948 | ret = btrfs_init_dev_replace(fs_info); |
2954 | if (ret) { | 2949 | if (ret) { |
2955 | pr_err("BTRFS: failed to init dev_replace: %d\n", ret); | 2950 | btrfs_err(fs_info, "failed to init dev_replace: %d", ret); |
2956 | goto fail_block_groups; | 2951 | goto fail_block_groups; |
2957 | } | 2952 | } |
2958 | 2953 | ||
@@ -2960,31 +2955,33 @@ retry_root_backup: | |||
2960 | 2955 | ||
2961 | ret = btrfs_sysfs_add_fsid(fs_devices, NULL); | 2956 | ret = btrfs_sysfs_add_fsid(fs_devices, NULL); |
2962 | if (ret) { | 2957 | if (ret) { |
2963 | pr_err("BTRFS: failed to init sysfs fsid interface: %d\n", ret); | 2958 | btrfs_err(fs_info, "failed to init sysfs fsid interface: %d", |
2959 | ret); | ||
2964 | goto fail_block_groups; | 2960 | goto fail_block_groups; |
2965 | } | 2961 | } |
2966 | 2962 | ||
2967 | ret = btrfs_sysfs_add_device(fs_devices); | 2963 | ret = btrfs_sysfs_add_device(fs_devices); |
2968 | if (ret) { | 2964 | if (ret) { |
2969 | pr_err("BTRFS: failed to init sysfs device interface: %d\n", ret); | 2965 | btrfs_err(fs_info, "failed to init sysfs device interface: %d", |
2966 | ret); | ||
2970 | goto fail_fsdev_sysfs; | 2967 | goto fail_fsdev_sysfs; |
2971 | } | 2968 | } |
2972 | 2969 | ||
2973 | ret = btrfs_sysfs_add_mounted(fs_info); | 2970 | ret = btrfs_sysfs_add_mounted(fs_info); |
2974 | if (ret) { | 2971 | if (ret) { |
2975 | pr_err("BTRFS: failed to init sysfs interface: %d\n", ret); | 2972 | btrfs_err(fs_info, "failed to init sysfs interface: %d", ret); |
2976 | goto fail_fsdev_sysfs; | 2973 | goto fail_fsdev_sysfs; |
2977 | } | 2974 | } |
2978 | 2975 | ||
2979 | ret = btrfs_init_space_info(fs_info); | 2976 | ret = btrfs_init_space_info(fs_info); |
2980 | if (ret) { | 2977 | if (ret) { |
2981 | printk(KERN_ERR "BTRFS: Failed to initial space info: %d\n", ret); | 2978 | btrfs_err(fs_info, "failed to initialize space info: %d", ret); |
2982 | goto fail_sysfs; | 2979 | goto fail_sysfs; |
2983 | } | 2980 | } |
2984 | 2981 | ||
2985 | ret = btrfs_read_block_groups(fs_info->extent_root); | 2982 | ret = btrfs_read_block_groups(fs_info->extent_root); |
2986 | if (ret) { | 2983 | if (ret) { |
2987 | printk(KERN_ERR "BTRFS: Failed to read block groups: %d\n", ret); | 2984 | btrfs_err(fs_info, "failed to read block groups: %d", ret); |
2988 | goto fail_sysfs; | 2985 | goto fail_sysfs; |
2989 | } | 2986 | } |
2990 | fs_info->num_tolerated_disk_barrier_failures = | 2987 | fs_info->num_tolerated_disk_barrier_failures = |
@@ -2992,7 +2989,8 @@ retry_root_backup: | |||
2992 | if (fs_info->fs_devices->missing_devices > | 2989 | if (fs_info->fs_devices->missing_devices > |
2993 | fs_info->num_tolerated_disk_barrier_failures && | 2990 | fs_info->num_tolerated_disk_barrier_failures && |
2994 | !(sb->s_flags & MS_RDONLY)) { | 2991 | !(sb->s_flags & MS_RDONLY)) { |
2995 | pr_warn("BTRFS: missing devices(%llu) exceeds the limit(%d), writeable mount is not allowed\n", | 2992 | btrfs_warn(fs_info, |
2993 | "missing devices (%llu) exceeds the limit (%d), writeable mount is not allowed", | ||
2996 | fs_info->fs_devices->missing_devices, | 2994 | fs_info->fs_devices->missing_devices, |
2997 | fs_info->num_tolerated_disk_barrier_failures); | 2995 | fs_info->num_tolerated_disk_barrier_failures); |
2998 | goto fail_sysfs; | 2996 | goto fail_sysfs; |
@@ -3019,8 +3017,7 @@ retry_root_backup: | |||
3019 | if (!btrfs_test_opt(tree_root, SSD) && | 3017 | if (!btrfs_test_opt(tree_root, SSD) && |
3020 | !btrfs_test_opt(tree_root, NOSSD) && | 3018 | !btrfs_test_opt(tree_root, NOSSD) && |
3021 | !fs_info->fs_devices->rotating) { | 3019 | !fs_info->fs_devices->rotating) { |
3022 | printk(KERN_INFO "BTRFS: detected SSD devices, enabling SSD " | 3020 | btrfs_info(fs_info, "detected SSD devices, enabling SSD mode"); |
3023 | "mode\n"); | ||
3024 | btrfs_set_opt(fs_info->mount_opt, SSD); | 3021 | btrfs_set_opt(fs_info->mount_opt, SSD); |
3025 | } | 3022 | } |
3026 | 3023 | ||
@@ -3038,8 +3035,9 @@ retry_root_backup: | |||
3038 | 1 : 0, | 3035 | 1 : 0, |
3039 | fs_info->check_integrity_print_mask); | 3036 | fs_info->check_integrity_print_mask); |
3040 | if (ret) | 3037 | if (ret) |
3041 | printk(KERN_WARNING "BTRFS: failed to initialize" | 3038 | btrfs_warn(fs_info, |
3042 | " integrity check module %s\n", sb->s_id); | 3039 | "failed to initialize integrity check module: %d", |
3040 | ret); | ||
3043 | } | 3041 | } |
3044 | #endif | 3042 | #endif |
3045 | ret = btrfs_read_qgroup_config(fs_info); | 3043 | ret = btrfs_read_qgroup_config(fs_info); |
@@ -3067,8 +3065,8 @@ retry_root_backup: | |||
3067 | /* We locked cleaner_mutex before creating cleaner_kthread. */ | 3065 | /* We locked cleaner_mutex before creating cleaner_kthread. */ |
3068 | ret = btrfs_recover_relocation(tree_root); | 3066 | ret = btrfs_recover_relocation(tree_root); |
3069 | if (ret < 0) { | 3067 | if (ret < 0) { |
3070 | printk(KERN_WARNING | 3068 | btrfs_warn(fs_info, "failed to recover relocation: %d", |
3071 | "BTRFS: failed to recover relocation\n"); | 3069 | ret); |
3072 | err = -EINVAL; | 3070 | err = -EINVAL; |
3073 | goto fail_qgroup; | 3071 | goto fail_qgroup; |
3074 | } | 3072 | } |
@@ -3091,11 +3089,11 @@ retry_root_backup: | |||
3091 | 3089 | ||
3092 | if (btrfs_test_opt(tree_root, FREE_SPACE_TREE) && | 3090 | if (btrfs_test_opt(tree_root, FREE_SPACE_TREE) && |
3093 | !btrfs_fs_compat_ro(fs_info, FREE_SPACE_TREE)) { | 3091 | !btrfs_fs_compat_ro(fs_info, FREE_SPACE_TREE)) { |
3094 | pr_info("BTRFS: creating free space tree\n"); | 3092 | btrfs_info(fs_info, "creating free space tree"); |
3095 | ret = btrfs_create_free_space_tree(fs_info); | 3093 | ret = btrfs_create_free_space_tree(fs_info); |
3096 | if (ret) { | 3094 | if (ret) { |
3097 | pr_warn("BTRFS: failed to create free space tree %d\n", | 3095 | btrfs_warn(fs_info, |
3098 | ret); | 3096 | "failed to create free space tree: %d", ret); |
3099 | close_ctree(tree_root); | 3097 | close_ctree(tree_root); |
3100 | return ret; | 3098 | return ret; |
3101 | } | 3099 | } |
@@ -3112,14 +3110,14 @@ retry_root_backup: | |||
3112 | 3110 | ||
3113 | ret = btrfs_resume_balance_async(fs_info); | 3111 | ret = btrfs_resume_balance_async(fs_info); |
3114 | if (ret) { | 3112 | if (ret) { |
3115 | printk(KERN_WARNING "BTRFS: failed to resume balance\n"); | 3113 | btrfs_warn(fs_info, "failed to resume balance: %d", ret); |
3116 | close_ctree(tree_root); | 3114 | close_ctree(tree_root); |
3117 | return ret; | 3115 | return ret; |
3118 | } | 3116 | } |
3119 | 3117 | ||
3120 | ret = btrfs_resume_dev_replace_async(fs_info); | 3118 | ret = btrfs_resume_dev_replace_async(fs_info); |
3121 | if (ret) { | 3119 | if (ret) { |
3122 | pr_warn("BTRFS: failed to resume dev_replace\n"); | 3120 | btrfs_warn(fs_info, "failed to resume device replace: %d", ret); |
3123 | close_ctree(tree_root); | 3121 | close_ctree(tree_root); |
3124 | return ret; | 3122 | return ret; |
3125 | } | 3123 | } |
@@ -3128,33 +3126,33 @@ retry_root_backup: | |||
3128 | 3126 | ||
3129 | if (btrfs_test_opt(tree_root, CLEAR_CACHE) && | 3127 | if (btrfs_test_opt(tree_root, CLEAR_CACHE) && |
3130 | btrfs_fs_compat_ro(fs_info, FREE_SPACE_TREE)) { | 3128 | btrfs_fs_compat_ro(fs_info, FREE_SPACE_TREE)) { |
3131 | pr_info("BTRFS: clearing free space tree\n"); | 3129 | btrfs_info(fs_info, "clearing free space tree"); |
3132 | ret = btrfs_clear_free_space_tree(fs_info); | 3130 | ret = btrfs_clear_free_space_tree(fs_info); |
3133 | if (ret) { | 3131 | if (ret) { |
3134 | pr_warn("BTRFS: failed to clear free space tree %d\n", | 3132 | btrfs_warn(fs_info, |
3135 | ret); | 3133 | "failed to clear free space tree: %d", ret); |
3136 | close_ctree(tree_root); | 3134 | close_ctree(tree_root); |
3137 | return ret; | 3135 | return ret; |
3138 | } | 3136 | } |
3139 | } | 3137 | } |
3140 | 3138 | ||
3141 | if (!fs_info->uuid_root) { | 3139 | if (!fs_info->uuid_root) { |
3142 | pr_info("BTRFS: creating UUID tree\n"); | 3140 | btrfs_info(fs_info, "creating UUID tree"); |
3143 | ret = btrfs_create_uuid_tree(fs_info); | 3141 | ret = btrfs_create_uuid_tree(fs_info); |
3144 | if (ret) { | 3142 | if (ret) { |
3145 | pr_warn("BTRFS: failed to create the UUID tree %d\n", | 3143 | btrfs_warn(fs_info, |
3146 | ret); | 3144 | "failed to create the UUID tree: %d", ret); |
3147 | close_ctree(tree_root); | 3145 | close_ctree(tree_root); |
3148 | return ret; | 3146 | return ret; |
3149 | } | 3147 | } |
3150 | } else if (btrfs_test_opt(tree_root, RESCAN_UUID_TREE) || | 3148 | } else if (btrfs_test_opt(tree_root, RESCAN_UUID_TREE) || |
3151 | fs_info->generation != | 3149 | fs_info->generation != |
3152 | btrfs_super_uuid_tree_generation(disk_super)) { | 3150 | btrfs_super_uuid_tree_generation(disk_super)) { |
3153 | pr_info("BTRFS: checking UUID tree\n"); | 3151 | btrfs_info(fs_info, "checking UUID tree"); |
3154 | ret = btrfs_check_uuid_tree(fs_info); | 3152 | ret = btrfs_check_uuid_tree(fs_info); |
3155 | if (ret) { | 3153 | if (ret) { |
3156 | pr_warn("BTRFS: failed to check the UUID tree %d\n", | 3154 | btrfs_warn(fs_info, |
3157 | ret); | 3155 | "failed to check the UUID tree: %d", ret); |
3158 | close_ctree(tree_root); | 3156 | close_ctree(tree_root); |
3159 | return ret; | 3157 | return ret; |
3160 | } | 3158 | } |
@@ -3658,7 +3656,7 @@ static int write_all_supers(struct btrfs_root *root, int max_mirrors) | |||
3658 | if (ret) { | 3656 | if (ret) { |
3659 | mutex_unlock( | 3657 | mutex_unlock( |
3660 | &root->fs_info->fs_devices->device_list_mutex); | 3658 | &root->fs_info->fs_devices->device_list_mutex); |
3661 | btrfs_std_error(root->fs_info, ret, | 3659 | btrfs_handle_fs_error(root->fs_info, ret, |
3662 | "errors while submitting device barriers."); | 3660 | "errors while submitting device barriers."); |
3663 | return ret; | 3661 | return ret; |
3664 | } | 3662 | } |
@@ -3698,7 +3696,7 @@ static int write_all_supers(struct btrfs_root *root, int max_mirrors) | |||
3698 | mutex_unlock(&root->fs_info->fs_devices->device_list_mutex); | 3696 | mutex_unlock(&root->fs_info->fs_devices->device_list_mutex); |
3699 | 3697 | ||
3700 | /* FUA is masked off if unsupported and can't be the reason */ | 3698 | /* FUA is masked off if unsupported and can't be the reason */ |
3701 | btrfs_std_error(root->fs_info, -EIO, | 3699 | btrfs_handle_fs_error(root->fs_info, -EIO, |
3702 | "%d errors while writing supers", total_errors); | 3700 | "%d errors while writing supers", total_errors); |
3703 | return -EIO; | 3701 | return -EIO; |
3704 | } | 3702 | } |
@@ -3716,7 +3714,7 @@ static int write_all_supers(struct btrfs_root *root, int max_mirrors) | |||
3716 | } | 3714 | } |
3717 | mutex_unlock(&root->fs_info->fs_devices->device_list_mutex); | 3715 | mutex_unlock(&root->fs_info->fs_devices->device_list_mutex); |
3718 | if (total_errors > max_errors) { | 3716 | if (total_errors > max_errors) { |
3719 | btrfs_std_error(root->fs_info, -EIO, | 3717 | btrfs_handle_fs_error(root->fs_info, -EIO, |
3720 | "%d errors while writing supers", total_errors); | 3718 | "%d errors while writing supers", total_errors); |
3721 | return -EIO; | 3719 | return -EIO; |
3722 | } | 3720 | } |