@@ -763,6 +763,8 @@ int btrfs_parse_options(struct btrfs_fs_info *info, char *options,
763763 compress_force = false;
764764 no_compress ++ ;
765765 } else {
766+ btrfs_err (info , "unrecognized compression value %s" ,
767+ args [0 ].from );
766768 ret = - EINVAL ;
767769 goto out ;
768770 }
@@ -821,8 +823,11 @@ int btrfs_parse_options(struct btrfs_fs_info *info, char *options,
821823 case Opt_thread_pool :
822824 ret = match_int (& args [0 ], & intarg );
823825 if (ret ) {
826+ btrfs_err (info , "unrecognized thread_pool value %s" ,
827+ args [0 ].from );
824828 goto out ;
825829 } else if (intarg == 0 ) {
830+ btrfs_err (info , "invalid value 0 for thread_pool" );
826831 ret = - EINVAL ;
827832 goto out ;
828833 }
@@ -883,8 +888,11 @@ int btrfs_parse_options(struct btrfs_fs_info *info, char *options,
883888 break ;
884889 case Opt_ratio :
885890 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 );
887894 goto out ;
895+ }
888896 info -> metadata_ratio = intarg ;
889897 btrfs_info (info , "metadata ratio %u" ,
890898 info -> metadata_ratio );
@@ -901,6 +909,8 @@ int btrfs_parse_options(struct btrfs_fs_info *info, char *options,
901909 btrfs_set_and_info (info , DISCARD_ASYNC ,
902910 "turning on async discard" );
903911 } else {
912+ btrfs_err (info , "unrecognized discard mode value %s" ,
913+ args [0 ].from );
904914 ret = - EINVAL ;
905915 goto out ;
906916 }
@@ -933,6 +943,8 @@ int btrfs_parse_options(struct btrfs_fs_info *info, char *options,
933943 btrfs_set_and_info (info , FREE_SPACE_TREE ,
934944 "enabling free space tree" );
935945 } else {
946+ btrfs_err (info , "unrecognized space_cache value %s" ,
947+ args [0 ].from );
936948 ret = - EINVAL ;
937949 goto out ;
938950 }
@@ -1014,8 +1026,12 @@ int btrfs_parse_options(struct btrfs_fs_info *info, char *options,
10141026 break ;
10151027 case Opt_check_integrity_print_mask :
10161028 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 );
10181033 goto out ;
1034+ }
10191035 info -> check_integrity_print_mask = intarg ;
10201036 btrfs_info (info , "check_integrity_print_mask 0x%x" ,
10211037 info -> check_integrity_print_mask );
@@ -1030,22 +1046,28 @@ int btrfs_parse_options(struct btrfs_fs_info *info, char *options,
10301046 goto out ;
10311047#endif
10321048 case Opt_fatal_errors :
1033- if (strcmp (args [0 ].from , "panic" ) == 0 )
1049+ if (strcmp (args [0 ].from , "panic" ) == 0 ) {
10341050 btrfs_set_opt (info -> mount_opt ,
10351051 PANIC_ON_FATAL_ERROR );
1036- else if (strcmp (args [0 ].from , "bug" ) == 0 )
1052+ } else if (strcmp (args [0 ].from , "bug" ) == 0 ) {
10371053 btrfs_clear_opt (info -> mount_opt ,
10381054 PANIC_ON_FATAL_ERROR );
1039- else {
1055+ } else {
1056+ btrfs_err (info , "unrecognized fatal_errors value %s" ,
1057+ args [0 ].from );
10401058 ret = - EINVAL ;
10411059 goto out ;
10421060 }
10431061 break ;
10441062 case Opt_commit_interval :
10451063 intarg = 0 ;
10461064 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 ;
10481069 goto out ;
1070+ }
10491071 if (intarg == 0 ) {
10501072 btrfs_info (info ,
10511073 "using default commit interval %us" ,
@@ -1059,8 +1081,11 @@ int btrfs_parse_options(struct btrfs_fs_info *info, char *options,
10591081 break ;
10601082 case Opt_rescue :
10611083 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 );
10631087 goto out ;
1088+ }
10641089 break ;
10651090#ifdef CONFIG_BTRFS_DEBUG
10661091 case Opt_fragment_all :
@@ -1985,6 +2010,14 @@ static int btrfs_remount(struct super_block *sb, int *flags, char *data)
19852010 if (ret )
19862011 goto restore ;
19872012
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+ }
19882021 btrfs_remount_begin (fs_info , old_opts , * flags );
19892022 btrfs_resize_thread_pool (fs_info ,
19902023 fs_info -> thread_pool_size , old_thread_pool_size );
0 commit comments