@@ -763,6 +763,8 @@ int btrfs_parse_options(struct btrfs_fs_info *info, char *options,
763
763
compress_force = false;
764
764
no_compress ++ ;
765
765
} else {
766
+ btrfs_err (info , "unrecognized compression value %s" ,
767
+ args [0 ].from );
766
768
ret = - EINVAL ;
767
769
goto out ;
768
770
}
@@ -821,8 +823,11 @@ int btrfs_parse_options(struct btrfs_fs_info *info, char *options,
821
823
case Opt_thread_pool :
822
824
ret = match_int (& args [0 ], & intarg );
823
825
if (ret ) {
826
+ btrfs_err (info , "unrecognized thread_pool value %s" ,
827
+ args [0 ].from );
824
828
goto out ;
825
829
} else if (intarg == 0 ) {
830
+ btrfs_err (info , "invalid value 0 for thread_pool" );
826
831
ret = - EINVAL ;
827
832
goto out ;
828
833
}
@@ -883,8 +888,11 @@ int btrfs_parse_options(struct btrfs_fs_info *info, char *options,
883
888
break ;
884
889
case Opt_ratio :
885
890
ret = match_int (& args [0 ], & intarg );
886
- if (ret )
891
+ if (ret ) {
892
+ btrfs_err (info , "unrecognized metadata_ratio value %s" ,
893
+ args [0 ].from );
887
894
goto out ;
895
+ }
888
896
info -> metadata_ratio = intarg ;
889
897
btrfs_info (info , "metadata ratio %u" ,
890
898
info -> metadata_ratio );
@@ -901,6 +909,8 @@ int btrfs_parse_options(struct btrfs_fs_info *info, char *options,
901
909
btrfs_set_and_info (info , DISCARD_ASYNC ,
902
910
"turning on async discard" );
903
911
} else {
912
+ btrfs_err (info , "unrecognized discard mode value %s" ,
913
+ args [0 ].from );
904
914
ret = - EINVAL ;
905
915
goto out ;
906
916
}
@@ -933,6 +943,8 @@ int btrfs_parse_options(struct btrfs_fs_info *info, char *options,
933
943
btrfs_set_and_info (info , FREE_SPACE_TREE ,
934
944
"enabling free space tree" );
935
945
} else {
946
+ btrfs_err (info , "unrecognized space_cache value %s" ,
947
+ args [0 ].from );
936
948
ret = - EINVAL ;
937
949
goto out ;
938
950
}
@@ -1014,8 +1026,12 @@ int btrfs_parse_options(struct btrfs_fs_info *info, char *options,
1014
1026
break ;
1015
1027
case Opt_check_integrity_print_mask :
1016
1028
ret = match_int (& args [0 ], & intarg );
1017
- if (ret )
1029
+ if (ret ) {
1030
+ btrfs_err (info ,
1031
+ "unrecognized check_integrity_print_mask value %s" ,
1032
+ args [0 ].from );
1018
1033
goto out ;
1034
+ }
1019
1035
info -> check_integrity_print_mask = intarg ;
1020
1036
btrfs_info (info , "check_integrity_print_mask 0x%x" ,
1021
1037
info -> check_integrity_print_mask );
@@ -1030,22 +1046,28 @@ int btrfs_parse_options(struct btrfs_fs_info *info, char *options,
1030
1046
goto out ;
1031
1047
#endif
1032
1048
case Opt_fatal_errors :
1033
- if (strcmp (args [0 ].from , "panic" ) == 0 )
1049
+ if (strcmp (args [0 ].from , "panic" ) == 0 ) {
1034
1050
btrfs_set_opt (info -> mount_opt ,
1035
1051
PANIC_ON_FATAL_ERROR );
1036
- else if (strcmp (args [0 ].from , "bug" ) == 0 )
1052
+ } else if (strcmp (args [0 ].from , "bug" ) == 0 ) {
1037
1053
btrfs_clear_opt (info -> mount_opt ,
1038
1054
PANIC_ON_FATAL_ERROR );
1039
- else {
1055
+ } else {
1056
+ btrfs_err (info , "unrecognized fatal_errors value %s" ,
1057
+ args [0 ].from );
1040
1058
ret = - EINVAL ;
1041
1059
goto out ;
1042
1060
}
1043
1061
break ;
1044
1062
case Opt_commit_interval :
1045
1063
intarg = 0 ;
1046
1064
ret = match_int (& args [0 ], & intarg );
1047
- if (ret )
1065
+ if (ret ) {
1066
+ btrfs_err (info , "unrecognized commit_interval value %s" ,
1067
+ args [0 ].from );
1068
+ ret = - EINVAL ;
1048
1069
goto out ;
1070
+ }
1049
1071
if (intarg == 0 ) {
1050
1072
btrfs_info (info ,
1051
1073
"using default commit interval %us" ,
@@ -1059,8 +1081,11 @@ int btrfs_parse_options(struct btrfs_fs_info *info, char *options,
1059
1081
break ;
1060
1082
case Opt_rescue :
1061
1083
ret = parse_rescue_options (info , args [0 ].from );
1062
- if (ret < 0 )
1084
+ if (ret < 0 ) {
1085
+ btrfs_err (info , "unrecognized rescue value %s" ,
1086
+ args [0 ].from );
1063
1087
goto out ;
1088
+ }
1064
1089
break ;
1065
1090
#ifdef CONFIG_BTRFS_DEBUG
1066
1091
case Opt_fragment_all :
@@ -1985,6 +2010,14 @@ static int btrfs_remount(struct super_block *sb, int *flags, char *data)
1985
2010
if (ret )
1986
2011
goto restore ;
1987
2012
2013
+ /* V1 cache is not supported for subpage mount. */
2014
+ if (fs_info -> sectorsize < PAGE_SIZE && btrfs_test_opt (fs_info , SPACE_CACHE )) {
2015
+ btrfs_warn (fs_info ,
2016
+ "v1 space cache is not supported for page size %lu with sectorsize %u" ,
2017
+ PAGE_SIZE , fs_info -> sectorsize );
2018
+ ret = - EINVAL ;
2019
+ goto restore ;
2020
+ }
1988
2021
btrfs_remount_begin (fs_info , old_opts , * flags );
1989
2022
btrfs_resize_thread_pool (fs_info ,
1990
2023
fs_info -> thread_pool_size , old_thread_pool_size );
0 commit comments