diff options
author | Jeff Mahoney <jeffm@suse.com> | 2009-03-30 14:02:21 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-03-30 15:16:36 -0400 |
commit | 45b03d5e8e674eb6555b767e1c8eb40b671ff892 (patch) | |
tree | d74acd1be7f5102143df960e8cd692aadcc437df /fs/reiserfs/super.c | |
parent | 1d889d9958490888b3fad1d486145d9a03559cbc (diff) |
reiserfs: rework reiserfs_warning
ReiserFS warnings can be somewhat inconsistent.
In some cases:
* a unique identifier may be associated with it
* the function name may be included
* the device may be printed separately
This patch aims to make warnings more consistent. reiserfs_warning() prints
the device name, so printing it a second time is not required. The function
name for a warning is always helpful in debugging, so it is now automatically
inserted into the output. Hans has stated that every warning should have
a unique identifier. Some cases lack them, others really shouldn't have them.
reiserfs_warning() now expects an id associated with each message. In the
rare case where one isn't needed, "" will suffice.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/reiserfs/super.c')
-rw-r--r-- | fs/reiserfs/super.c | 257 |
1 files changed, 137 insertions, 120 deletions
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c index 0428004dc638..bfc276c8e978 100644 --- a/fs/reiserfs/super.c +++ b/fs/reiserfs/super.c | |||
@@ -183,9 +183,9 @@ static int finish_unfinished(struct super_block *s) | |||
183 | if (REISERFS_SB(s)->s_qf_names[i]) { | 183 | if (REISERFS_SB(s)->s_qf_names[i]) { |
184 | int ret = reiserfs_quota_on_mount(s, i); | 184 | int ret = reiserfs_quota_on_mount(s, i); |
185 | if (ret < 0) | 185 | if (ret < 0) |
186 | reiserfs_warning(s, | 186 | reiserfs_warning(s, "reiserfs-2500", |
187 | "reiserfs: cannot turn on journaled quota: error %d", | 187 | "cannot turn on journaled " |
188 | ret); | 188 | "quota: error %d", ret); |
189 | } | 189 | } |
190 | } | 190 | } |
191 | #endif | 191 | #endif |
@@ -195,8 +195,8 @@ static int finish_unfinished(struct super_block *s) | |||
195 | while (!retval) { | 195 | while (!retval) { |
196 | retval = search_item(s, &max_cpu_key, &path); | 196 | retval = search_item(s, &max_cpu_key, &path); |
197 | if (retval != ITEM_NOT_FOUND) { | 197 | if (retval != ITEM_NOT_FOUND) { |
198 | reiserfs_warning(s, | 198 | reiserfs_warning(s, "vs-2140", |
199 | "vs-2140: finish_unfinished: search_by_key returned %d", | 199 | "search_by_key returned %d", |
200 | retval); | 200 | retval); |
201 | break; | 201 | break; |
202 | } | 202 | } |
@@ -204,8 +204,8 @@ static int finish_unfinished(struct super_block *s) | |||
204 | bh = get_last_bh(&path); | 204 | bh = get_last_bh(&path); |
205 | item_pos = get_item_pos(&path); | 205 | item_pos = get_item_pos(&path); |
206 | if (item_pos != B_NR_ITEMS(bh)) { | 206 | if (item_pos != B_NR_ITEMS(bh)) { |
207 | reiserfs_warning(s, | 207 | reiserfs_warning(s, "vs-2060", |
208 | "vs-2060: finish_unfinished: wrong position found"); | 208 | "wrong position found"); |
209 | break; | 209 | break; |
210 | } | 210 | } |
211 | item_pos--; | 211 | item_pos--; |
@@ -235,8 +235,7 @@ static int finish_unfinished(struct super_block *s) | |||
235 | if (!inode) { | 235 | if (!inode) { |
236 | /* the unlink almost completed, it just did not manage to remove | 236 | /* the unlink almost completed, it just did not manage to remove |
237 | "save" link and release objectid */ | 237 | "save" link and release objectid */ |
238 | reiserfs_warning(s, | 238 | reiserfs_warning(s, "vs-2180", "iget failed for %K", |
239 | "vs-2180: finish_unfinished: iget failed for %K", | ||
240 | &obj_key); | 239 | &obj_key); |
241 | retval = remove_save_link_only(s, &save_link_key, 1); | 240 | retval = remove_save_link_only(s, &save_link_key, 1); |
242 | continue; | 241 | continue; |
@@ -244,8 +243,8 @@ static int finish_unfinished(struct super_block *s) | |||
244 | 243 | ||
245 | if (!truncate && inode->i_nlink) { | 244 | if (!truncate && inode->i_nlink) { |
246 | /* file is not unlinked */ | 245 | /* file is not unlinked */ |
247 | reiserfs_warning(s, | 246 | reiserfs_warning(s, "vs-2185", |
248 | "vs-2185: finish_unfinished: file %K is not unlinked", | 247 | "file %K is not unlinked", |
249 | &obj_key); | 248 | &obj_key); |
250 | retval = remove_save_link_only(s, &save_link_key, 0); | 249 | retval = remove_save_link_only(s, &save_link_key, 0); |
251 | continue; | 250 | continue; |
@@ -257,8 +256,9 @@ static int finish_unfinished(struct super_block *s) | |||
257 | The only imaginable way is to execute unfinished truncate request | 256 | The only imaginable way is to execute unfinished truncate request |
258 | then boot into old kernel, remove the file and create dir with | 257 | then boot into old kernel, remove the file and create dir with |
259 | the same key. */ | 258 | the same key. */ |
260 | reiserfs_warning(s, | 259 | reiserfs_warning(s, "green-2101", |
261 | "green-2101: impossible truncate on a directory %k. Please report", | 260 | "impossible truncate on a " |
261 | "directory %k. Please report", | ||
262 | INODE_PKEY(inode)); | 262 | INODE_PKEY(inode)); |
263 | retval = remove_save_link_only(s, &save_link_key, 0); | 263 | retval = remove_save_link_only(s, &save_link_key, 0); |
264 | truncate = 0; | 264 | truncate = 0; |
@@ -288,9 +288,10 @@ static int finish_unfinished(struct super_block *s) | |||
288 | /* removal gets completed in iput */ | 288 | /* removal gets completed in iput */ |
289 | retval = 0; | 289 | retval = 0; |
290 | } else { | 290 | } else { |
291 | reiserfs_warning(s, "Dead loop in " | 291 | reiserfs_warning(s, "super-2189", "Dead loop " |
292 | "finish_unfinished detected, " | 292 | "in finish_unfinished " |
293 | "just remove save link\n"); | 293 | "detected, just remove " |
294 | "save link\n"); | ||
294 | retval = remove_save_link_only(s, | 295 | retval = remove_save_link_only(s, |
295 | &save_link_key, 0); | 296 | &save_link_key, 0); |
296 | } | 297 | } |
@@ -360,8 +361,9 @@ void add_save_link(struct reiserfs_transaction_handle *th, | |||
360 | } else { | 361 | } else { |
361 | /* truncate */ | 362 | /* truncate */ |
362 | if (S_ISDIR(inode->i_mode)) | 363 | if (S_ISDIR(inode->i_mode)) |
363 | reiserfs_warning(inode->i_sb, | 364 | reiserfs_warning(inode->i_sb, "green-2102", |
364 | "green-2102: Adding a truncate savelink for a directory %k! Please report", | 365 | "Adding a truncate savelink for " |
366 | "a directory %k! Please report", | ||
365 | INODE_PKEY(inode)); | 367 | INODE_PKEY(inode)); |
366 | set_cpu_key_k_offset(&key, 1); | 368 | set_cpu_key_k_offset(&key, 1); |
367 | set_cpu_key_k_type(&key, TYPE_INDIRECT); | 369 | set_cpu_key_k_type(&key, TYPE_INDIRECT); |
@@ -376,7 +378,7 @@ void add_save_link(struct reiserfs_transaction_handle *th, | |||
376 | retval = search_item(inode->i_sb, &key, &path); | 378 | retval = search_item(inode->i_sb, &key, &path); |
377 | if (retval != ITEM_NOT_FOUND) { | 379 | if (retval != ITEM_NOT_FOUND) { |
378 | if (retval != -ENOSPC) | 380 | if (retval != -ENOSPC) |
379 | reiserfs_warning(inode->i_sb, "vs-2100: add_save_link:" | 381 | reiserfs_warning(inode->i_sb, "vs-2100", |
380 | "search_by_key (%K) returned %d", &key, | 382 | "search_by_key (%K) returned %d", &key, |
381 | retval); | 383 | retval); |
382 | pathrelse(&path); | 384 | pathrelse(&path); |
@@ -391,9 +393,8 @@ void add_save_link(struct reiserfs_transaction_handle *th, | |||
391 | reiserfs_insert_item(th, &path, &key, &ih, NULL, (char *)&link); | 393 | reiserfs_insert_item(th, &path, &key, &ih, NULL, (char *)&link); |
392 | if (retval) { | 394 | if (retval) { |
393 | if (retval != -ENOSPC) | 395 | if (retval != -ENOSPC) |
394 | reiserfs_warning(inode->i_sb, | 396 | reiserfs_warning(inode->i_sb, "vs-2120", |
395 | "vs-2120: add_save_link: insert_item returned %d", | 397 | "insert_item returned %d", retval); |
396 | retval); | ||
397 | } else { | 398 | } else { |
398 | if (truncate) | 399 | if (truncate) |
399 | REISERFS_I(inode)->i_flags |= | 400 | REISERFS_I(inode)->i_flags |= |
@@ -492,8 +493,7 @@ static void reiserfs_put_super(struct super_block *s) | |||
492 | print_statistics(s); | 493 | print_statistics(s); |
493 | 494 | ||
494 | if (REISERFS_SB(s)->reserved_blocks != 0) { | 495 | if (REISERFS_SB(s)->reserved_blocks != 0) { |
495 | reiserfs_warning(s, | 496 | reiserfs_warning(s, "green-2005", "reserved blocks left %d", |
496 | "green-2005: reiserfs_put_super: reserved blocks left %d", | ||
497 | REISERFS_SB(s)->reserved_blocks); | 497 | REISERFS_SB(s)->reserved_blocks); |
498 | } | 498 | } |
499 | 499 | ||
@@ -559,8 +559,8 @@ static void reiserfs_dirty_inode(struct inode *inode) | |||
559 | 559 | ||
560 | int err = 0; | 560 | int err = 0; |
561 | if (inode->i_sb->s_flags & MS_RDONLY) { | 561 | if (inode->i_sb->s_flags & MS_RDONLY) { |
562 | reiserfs_warning(inode->i_sb, | 562 | reiserfs_warning(inode->i_sb, "clm-6006", |
563 | "clm-6006: writing inode %lu on readonly FS", | 563 | "writing inode %lu on readonly FS", |
564 | inode->i_ino); | 564 | inode->i_ino); |
565 | return; | 565 | return; |
566 | } | 566 | } |
@@ -794,13 +794,15 @@ static int reiserfs_getopt(struct super_block *s, char **cur, opt_desc_t * opts, | |||
794 | if (bit_flags) { | 794 | if (bit_flags) { |
795 | if (opt->clrmask == | 795 | if (opt->clrmask == |
796 | (1 << REISERFS_UNSUPPORTED_OPT)) | 796 | (1 << REISERFS_UNSUPPORTED_OPT)) |
797 | reiserfs_warning(s, "%s not supported.", | 797 | reiserfs_warning(s, "super-6500", |
798 | "%s not supported.\n", | ||
798 | p); | 799 | p); |
799 | else | 800 | else |
800 | *bit_flags &= ~opt->clrmask; | 801 | *bit_flags &= ~opt->clrmask; |
801 | if (opt->setmask == | 802 | if (opt->setmask == |
802 | (1 << REISERFS_UNSUPPORTED_OPT)) | 803 | (1 << REISERFS_UNSUPPORTED_OPT)) |
803 | reiserfs_warning(s, "%s not supported.", | 804 | reiserfs_warning(s, "super-6501", |
805 | "%s not supported.\n", | ||
804 | p); | 806 | p); |
805 | else | 807 | else |
806 | *bit_flags |= opt->setmask; | 808 | *bit_flags |= opt->setmask; |
@@ -809,7 +811,8 @@ static int reiserfs_getopt(struct super_block *s, char **cur, opt_desc_t * opts, | |||
809 | } | 811 | } |
810 | } | 812 | } |
811 | if (!opt->option_name) { | 813 | if (!opt->option_name) { |
812 | reiserfs_warning(s, "unknown mount option \"%s\"", p); | 814 | reiserfs_warning(s, "super-6502", |
815 | "unknown mount option \"%s\"", p); | ||
813 | return -1; | 816 | return -1; |
814 | } | 817 | } |
815 | 818 | ||
@@ -817,8 +820,9 @@ static int reiserfs_getopt(struct super_block *s, char **cur, opt_desc_t * opts, | |||
817 | switch (*p) { | 820 | switch (*p) { |
818 | case '=': | 821 | case '=': |
819 | if (!opt->arg_required) { | 822 | if (!opt->arg_required) { |
820 | reiserfs_warning(s, | 823 | reiserfs_warning(s, "super-6503", |
821 | "the option \"%s\" does not require an argument", | 824 | "the option \"%s\" does not " |
825 | "require an argument\n", | ||
822 | opt->option_name); | 826 | opt->option_name); |
823 | return -1; | 827 | return -1; |
824 | } | 828 | } |
@@ -826,14 +830,15 @@ static int reiserfs_getopt(struct super_block *s, char **cur, opt_desc_t * opts, | |||
826 | 830 | ||
827 | case 0: | 831 | case 0: |
828 | if (opt->arg_required) { | 832 | if (opt->arg_required) { |
829 | reiserfs_warning(s, | 833 | reiserfs_warning(s, "super-6504", |
830 | "the option \"%s\" requires an argument", | 834 | "the option \"%s\" requires an " |
831 | opt->option_name); | 835 | "argument\n", opt->option_name); |
832 | return -1; | 836 | return -1; |
833 | } | 837 | } |
834 | break; | 838 | break; |
835 | default: | 839 | default: |
836 | reiserfs_warning(s, "head of option \"%s\" is only correct", | 840 | reiserfs_warning(s, "super-6505", |
841 | "head of option \"%s\" is only correct\n", | ||
837 | opt->option_name); | 842 | opt->option_name); |
838 | return -1; | 843 | return -1; |
839 | } | 844 | } |
@@ -845,7 +850,8 @@ static int reiserfs_getopt(struct super_block *s, char **cur, opt_desc_t * opts, | |||
845 | && !(opt->arg_required & (1 << REISERFS_OPT_ALLOWEMPTY)) | 850 | && !(opt->arg_required & (1 << REISERFS_OPT_ALLOWEMPTY)) |
846 | && !strlen(p)) { | 851 | && !strlen(p)) { |
847 | /* this catches "option=," if not allowed */ | 852 | /* this catches "option=," if not allowed */ |
848 | reiserfs_warning(s, "empty argument for \"%s\"", | 853 | reiserfs_warning(s, "super-6506", |
854 | "empty argument for \"%s\"\n", | ||
849 | opt->option_name); | 855 | opt->option_name); |
850 | return -1; | 856 | return -1; |
851 | } | 857 | } |
@@ -867,7 +873,8 @@ static int reiserfs_getopt(struct super_block *s, char **cur, opt_desc_t * opts, | |||
867 | } | 873 | } |
868 | } | 874 | } |
869 | 875 | ||
870 | reiserfs_warning(s, "bad value \"%s\" for option \"%s\"", p, | 876 | reiserfs_warning(s, "super-6506", |
877 | "bad value \"%s\" for option \"%s\"\n", p, | ||
871 | opt->option_name); | 878 | opt->option_name); |
872 | return -1; | 879 | return -1; |
873 | } | 880 | } |
@@ -957,9 +964,9 @@ static int reiserfs_parse_options(struct super_block *s, char *options, /* strin | |||
957 | *blocks = simple_strtoul(arg, &p, 0); | 964 | *blocks = simple_strtoul(arg, &p, 0); |
958 | if (*p != '\0') { | 965 | if (*p != '\0') { |
959 | /* NNN does not look like a number */ | 966 | /* NNN does not look like a number */ |
960 | reiserfs_warning(s, | 967 | reiserfs_warning(s, "super-6507", |
961 | "reiserfs_parse_options: bad value %s", | 968 | "bad value %s for " |
962 | arg); | 969 | "-oresize\n", arg); |
963 | return 0; | 970 | return 0; |
964 | } | 971 | } |
965 | } | 972 | } |
@@ -970,8 +977,8 @@ static int reiserfs_parse_options(struct super_block *s, char *options, /* strin | |||
970 | unsigned long val = simple_strtoul(arg, &p, 0); | 977 | unsigned long val = simple_strtoul(arg, &p, 0); |
971 | /* commit=NNN (time in seconds) */ | 978 | /* commit=NNN (time in seconds) */ |
972 | if (*p != '\0' || val >= (unsigned int)-1) { | 979 | if (*p != '\0' || val >= (unsigned int)-1) { |
973 | reiserfs_warning(s, | 980 | reiserfs_warning(s, "super-6508", |
974 | "reiserfs_parse_options: bad value %s", | 981 | "bad value %s for -ocommit\n", |
975 | arg); | 982 | arg); |
976 | return 0; | 983 | return 0; |
977 | } | 984 | } |
@@ -979,16 +986,18 @@ static int reiserfs_parse_options(struct super_block *s, char *options, /* strin | |||
979 | } | 986 | } |
980 | 987 | ||
981 | if (c == 'w') { | 988 | if (c == 'w') { |
982 | reiserfs_warning(s, "reiserfs: nolargeio option is no longer supported"); | 989 | reiserfs_warning(s, "super-6509", "nolargeio option " |
990 | "is no longer supported"); | ||
983 | return 0; | 991 | return 0; |
984 | } | 992 | } |
985 | 993 | ||
986 | if (c == 'j') { | 994 | if (c == 'j') { |
987 | if (arg && *arg && jdev_name) { | 995 | if (arg && *arg && jdev_name) { |
988 | if (*jdev_name) { //Hm, already assigned? | 996 | if (*jdev_name) { //Hm, already assigned? |
989 | reiserfs_warning(s, | 997 | reiserfs_warning(s, "super-6510", |
990 | "reiserfs_parse_options: journal device was already specified to be %s", | 998 | "journal device was " |
991 | *jdev_name); | 999 | "already specified to " |
1000 | "be %s", *jdev_name); | ||
992 | return 0; | 1001 | return 0; |
993 | } | 1002 | } |
994 | *jdev_name = arg; | 1003 | *jdev_name = arg; |
@@ -1000,29 +1009,35 @@ static int reiserfs_parse_options(struct super_block *s, char *options, /* strin | |||
1000 | 1009 | ||
1001 | if (sb_any_quota_loaded(s) && | 1010 | if (sb_any_quota_loaded(s) && |
1002 | (!*arg != !REISERFS_SB(s)->s_qf_names[qtype])) { | 1011 | (!*arg != !REISERFS_SB(s)->s_qf_names[qtype])) { |
1003 | reiserfs_warning(s, | 1012 | reiserfs_warning(s, "super-6511", |
1004 | "reiserfs_parse_options: cannot change journaled quota options when quota turned on."); | 1013 | "cannot change journaled " |
1014 | "quota options when quota " | ||
1015 | "turned on."); | ||
1005 | return 0; | 1016 | return 0; |
1006 | } | 1017 | } |
1007 | if (*arg) { /* Some filename specified? */ | 1018 | if (*arg) { /* Some filename specified? */ |
1008 | if (REISERFS_SB(s)->s_qf_names[qtype] | 1019 | if (REISERFS_SB(s)->s_qf_names[qtype] |
1009 | && strcmp(REISERFS_SB(s)->s_qf_names[qtype], | 1020 | && strcmp(REISERFS_SB(s)->s_qf_names[qtype], |
1010 | arg)) { | 1021 | arg)) { |
1011 | reiserfs_warning(s, | 1022 | reiserfs_warning(s, "super-6512", |
1012 | "reiserfs_parse_options: %s quota file already specified.", | 1023 | "%s quota file " |
1024 | "already specified.", | ||
1013 | QTYPE2NAME(qtype)); | 1025 | QTYPE2NAME(qtype)); |
1014 | return 0; | 1026 | return 0; |
1015 | } | 1027 | } |
1016 | if (strchr(arg, '/')) { | 1028 | if (strchr(arg, '/')) { |
1017 | reiserfs_warning(s, | 1029 | reiserfs_warning(s, "super-6513", |
1018 | "reiserfs_parse_options: quotafile must be on filesystem root."); | 1030 | "quotafile must be " |
1031 | "on filesystem root."); | ||
1019 | return 0; | 1032 | return 0; |
1020 | } | 1033 | } |
1021 | qf_names[qtype] = | 1034 | qf_names[qtype] = |
1022 | kmalloc(strlen(arg) + 1, GFP_KERNEL); | 1035 | kmalloc(strlen(arg) + 1, GFP_KERNEL); |
1023 | if (!qf_names[qtype]) { | 1036 | if (!qf_names[qtype]) { |
1024 | reiserfs_warning(s, | 1037 | reiserfs_warning(s, "reiserfs-2502", |
1025 | "reiserfs_parse_options: not enough memory for storing quotafile name."); | 1038 | "not enough memory " |
1039 | "for storing " | ||
1040 | "quotafile name."); | ||
1026 | return 0; | 1041 | return 0; |
1027 | } | 1042 | } |
1028 | strcpy(qf_names[qtype], arg); | 1043 | strcpy(qf_names[qtype], arg); |
@@ -1040,21 +1055,24 @@ static int reiserfs_parse_options(struct super_block *s, char *options, /* strin | |||
1040 | else if (!strcmp(arg, "vfsv0")) | 1055 | else if (!strcmp(arg, "vfsv0")) |
1041 | *qfmt = QFMT_VFS_V0; | 1056 | *qfmt = QFMT_VFS_V0; |
1042 | else { | 1057 | else { |
1043 | reiserfs_warning(s, | 1058 | reiserfs_warning(s, "super-6514", |
1044 | "reiserfs_parse_options: unknown quota format specified."); | 1059 | "unknown quota format " |
1060 | "specified."); | ||
1045 | return 0; | 1061 | return 0; |
1046 | } | 1062 | } |
1047 | if (sb_any_quota_loaded(s) && | 1063 | if (sb_any_quota_loaded(s) && |
1048 | *qfmt != REISERFS_SB(s)->s_jquota_fmt) { | 1064 | *qfmt != REISERFS_SB(s)->s_jquota_fmt) { |
1049 | reiserfs_warning(s, | 1065 | reiserfs_warning(s, "super-6515", |
1050 | "reiserfs_parse_options: cannot change journaled quota options when quota turned on."); | 1066 | "cannot change journaled " |
1067 | "quota options when quota " | ||
1068 | "turned on."); | ||
1051 | return 0; | 1069 | return 0; |
1052 | } | 1070 | } |
1053 | } | 1071 | } |
1054 | #else | 1072 | #else |
1055 | if (c == 'u' || c == 'g' || c == 'f') { | 1073 | if (c == 'u' || c == 'g' || c == 'f') { |
1056 | reiserfs_warning(s, | 1074 | reiserfs_warning(s, "reiserfs-2503", "journaled " |
1057 | "reiserfs_parse_options: journaled quota options not supported."); | 1075 | "quota options not supported."); |
1058 | return 0; | 1076 | return 0; |
1059 | } | 1077 | } |
1060 | #endif | 1078 | #endif |
@@ -1063,15 +1081,15 @@ static int reiserfs_parse_options(struct super_block *s, char *options, /* strin | |||
1063 | #ifdef CONFIG_QUOTA | 1081 | #ifdef CONFIG_QUOTA |
1064 | if (!REISERFS_SB(s)->s_jquota_fmt && !*qfmt | 1082 | if (!REISERFS_SB(s)->s_jquota_fmt && !*qfmt |
1065 | && (qf_names[USRQUOTA] || qf_names[GRPQUOTA])) { | 1083 | && (qf_names[USRQUOTA] || qf_names[GRPQUOTA])) { |
1066 | reiserfs_warning(s, | 1084 | reiserfs_warning(s, "super-6515", |
1067 | "reiserfs_parse_options: journaled quota format not specified."); | 1085 | "journaled quota format not specified."); |
1068 | return 0; | 1086 | return 0; |
1069 | } | 1087 | } |
1070 | /* This checking is not precise wrt the quota type but for our purposes it is sufficient */ | 1088 | /* This checking is not precise wrt the quota type but for our purposes it is sufficient */ |
1071 | if (!(*mount_options & (1 << REISERFS_QUOTA)) | 1089 | if (!(*mount_options & (1 << REISERFS_QUOTA)) |
1072 | && sb_any_quota_loaded(s)) { | 1090 | && sb_any_quota_loaded(s)) { |
1073 | reiserfs_warning(s, | 1091 | reiserfs_warning(s, "super-6516", "quota options must " |
1074 | "reiserfs_parse_options: quota options must be present when quota is turned on."); | 1092 | "be present when quota is turned on."); |
1075 | return 0; | 1093 | return 0; |
1076 | } | 1094 | } |
1077 | #endif | 1095 | #endif |
@@ -1131,14 +1149,15 @@ static void handle_attrs(struct super_block *s) | |||
1131 | 1149 | ||
1132 | if (reiserfs_attrs(s)) { | 1150 | if (reiserfs_attrs(s)) { |
1133 | if (old_format_only(s)) { | 1151 | if (old_format_only(s)) { |
1134 | reiserfs_warning(s, | 1152 | reiserfs_warning(s, "super-6517", "cannot support " |
1135 | "reiserfs: cannot support attributes on 3.5.x disk format"); | 1153 | "attributes on 3.5.x disk format"); |
1136 | REISERFS_SB(s)->s_mount_opt &= ~(1 << REISERFS_ATTRS); | 1154 | REISERFS_SB(s)->s_mount_opt &= ~(1 << REISERFS_ATTRS); |
1137 | return; | 1155 | return; |
1138 | } | 1156 | } |
1139 | if (!(le32_to_cpu(rs->s_flags) & reiserfs_attrs_cleared)) { | 1157 | if (!(le32_to_cpu(rs->s_flags) & reiserfs_attrs_cleared)) { |
1140 | reiserfs_warning(s, | 1158 | reiserfs_warning(s, "super-6518", "cannot support " |
1141 | "reiserfs: cannot support attributes until flag is set in super-block"); | 1159 | "attributes until flag is set in " |
1160 | "super-block"); | ||
1142 | REISERFS_SB(s)->s_mount_opt &= ~(1 << REISERFS_ATTRS); | 1161 | REISERFS_SB(s)->s_mount_opt &= ~(1 << REISERFS_ATTRS); |
1143 | } | 1162 | } |
1144 | } | 1163 | } |
@@ -1316,7 +1335,7 @@ static int read_super_block(struct super_block *s, int offset) | |||
1316 | 1335 | ||
1317 | bh = sb_bread(s, offset / s->s_blocksize); | 1336 | bh = sb_bread(s, offset / s->s_blocksize); |
1318 | if (!bh) { | 1337 | if (!bh) { |
1319 | reiserfs_warning(s, "sh-2006: read_super_block: " | 1338 | reiserfs_warning(s, "sh-2006", |
1320 | "bread failed (dev %s, block %lu, size %lu)", | 1339 | "bread failed (dev %s, block %lu, size %lu)", |
1321 | reiserfs_bdevname(s), offset / s->s_blocksize, | 1340 | reiserfs_bdevname(s), offset / s->s_blocksize, |
1322 | s->s_blocksize); | 1341 | s->s_blocksize); |
@@ -1337,8 +1356,8 @@ static int read_super_block(struct super_block *s, int offset) | |||
1337 | 1356 | ||
1338 | bh = sb_bread(s, offset / s->s_blocksize); | 1357 | bh = sb_bread(s, offset / s->s_blocksize); |
1339 | if (!bh) { | 1358 | if (!bh) { |
1340 | reiserfs_warning(s, "sh-2007: read_super_block: " | 1359 | reiserfs_warning(s, "sh-2007", |
1341 | "bread failed (dev %s, block %lu, size %lu)\n", | 1360 | "bread failed (dev %s, block %lu, size %lu)", |
1342 | reiserfs_bdevname(s), offset / s->s_blocksize, | 1361 | reiserfs_bdevname(s), offset / s->s_blocksize, |
1343 | s->s_blocksize); | 1362 | s->s_blocksize); |
1344 | return 1; | 1363 | return 1; |
@@ -1346,8 +1365,8 @@ static int read_super_block(struct super_block *s, int offset) | |||
1346 | 1365 | ||
1347 | rs = (struct reiserfs_super_block *)bh->b_data; | 1366 | rs = (struct reiserfs_super_block *)bh->b_data; |
1348 | if (sb_blocksize(rs) != s->s_blocksize) { | 1367 | if (sb_blocksize(rs) != s->s_blocksize) { |
1349 | reiserfs_warning(s, "sh-2011: read_super_block: " | 1368 | reiserfs_warning(s, "sh-2011", "can't find a reiserfs " |
1350 | "can't find a reiserfs filesystem on (dev %s, block %Lu, size %lu)\n", | 1369 | "filesystem on (dev %s, block %Lu, size %lu)", |
1351 | reiserfs_bdevname(s), | 1370 | reiserfs_bdevname(s), |
1352 | (unsigned long long)bh->b_blocknr, | 1371 | (unsigned long long)bh->b_blocknr, |
1353 | s->s_blocksize); | 1372 | s->s_blocksize); |
@@ -1357,9 +1376,10 @@ static int read_super_block(struct super_block *s, int offset) | |||
1357 | 1376 | ||
1358 | if (rs->s_v1.s_root_block == cpu_to_le32(-1)) { | 1377 | if (rs->s_v1.s_root_block == cpu_to_le32(-1)) { |
1359 | brelse(bh); | 1378 | brelse(bh); |
1360 | reiserfs_warning(s, | 1379 | reiserfs_warning(s, "super-6519", "Unfinished reiserfsck " |
1361 | "Unfinished reiserfsck --rebuild-tree run detected. Please run\n" | 1380 | "--rebuild-tree run detected. Please run\n" |
1362 | "reiserfsck --rebuild-tree and wait for a completion. If that fails\n" | 1381 | "reiserfsck --rebuild-tree and wait for a " |
1382 | "completion. If that fails\n" | ||
1363 | "get newer reiserfsprogs package"); | 1383 | "get newer reiserfsprogs package"); |
1364 | return 1; | 1384 | return 1; |
1365 | } | 1385 | } |
@@ -1377,10 +1397,9 @@ static int read_super_block(struct super_block *s, int offset) | |||
1377 | reiserfs_info(s, "found reiserfs format \"3.5\"" | 1397 | reiserfs_info(s, "found reiserfs format \"3.5\"" |
1378 | " with non-standard journal\n"); | 1398 | " with non-standard journal\n"); |
1379 | else { | 1399 | else { |
1380 | reiserfs_warning(s, | 1400 | reiserfs_warning(s, "sh-2012", "found unknown " |
1381 | "sh-2012: read_super_block: found unknown " | 1401 | "format \"%u\" of reiserfs with " |
1382 | "format \"%u\" of reiserfs with non-standard magic", | 1402 | "non-standard magic", sb_version(rs)); |
1383 | sb_version(rs)); | ||
1384 | return 1; | 1403 | return 1; |
1385 | } | 1404 | } |
1386 | } else | 1405 | } else |
@@ -1410,8 +1429,7 @@ static int reread_meta_blocks(struct super_block *s) | |||
1410 | ll_rw_block(READ, 1, &(SB_BUFFER_WITH_SB(s))); | 1429 | ll_rw_block(READ, 1, &(SB_BUFFER_WITH_SB(s))); |
1411 | wait_on_buffer(SB_BUFFER_WITH_SB(s)); | 1430 | wait_on_buffer(SB_BUFFER_WITH_SB(s)); |
1412 | if (!buffer_uptodate(SB_BUFFER_WITH_SB(s))) { | 1431 | if (!buffer_uptodate(SB_BUFFER_WITH_SB(s))) { |
1413 | reiserfs_warning(s, | 1432 | reiserfs_warning(s, "reiserfs-2504", "error reading the super"); |
1414 | "reread_meta_blocks, error reading the super"); | ||
1415 | return 1; | 1433 | return 1; |
1416 | } | 1434 | } |
1417 | 1435 | ||
@@ -1475,10 +1493,10 @@ static __u32 find_hash_out(struct super_block *s) | |||
1475 | && (yurahash == | 1493 | && (yurahash == |
1476 | GET_HASH_VALUE(deh_offset | 1494 | GET_HASH_VALUE(deh_offset |
1477 | (&(de.de_deh[de.de_entry_num])))))) { | 1495 | (&(de.de_deh[de.de_entry_num])))))) { |
1478 | reiserfs_warning(s, | 1496 | reiserfs_warning(s, "reiserfs-2506", "Unable to " |
1479 | "Unable to automatically detect hash function. " | 1497 | "automatically detect hash function. " |
1480 | "Please mount with -o hash={tea,rupasov,r5}", | 1498 | "Please mount with -o " |
1481 | reiserfs_bdevname(s)); | 1499 | "hash={tea,rupasov,r5}"); |
1482 | hash = UNSET_HASH; | 1500 | hash = UNSET_HASH; |
1483 | break; | 1501 | break; |
1484 | } | 1502 | } |
@@ -1492,7 +1510,8 @@ static __u32 find_hash_out(struct super_block *s) | |||
1492 | (deh_offset(&(de.de_deh[de.de_entry_num]))) == r5hash) | 1510 | (deh_offset(&(de.de_deh[de.de_entry_num]))) == r5hash) |
1493 | hash = R5_HASH; | 1511 | hash = R5_HASH; |
1494 | else { | 1512 | else { |
1495 | reiserfs_warning(s, "Unrecognised hash function"); | 1513 | reiserfs_warning(s, "reiserfs-2506", |
1514 | "Unrecognised hash function"); | ||
1496 | hash = UNSET_HASH; | 1515 | hash = UNSET_HASH; |
1497 | } | 1516 | } |
1498 | } while (0); | 1517 | } while (0); |
@@ -1520,17 +1539,20 @@ static int what_hash(struct super_block *s) | |||
1520 | ** mount options | 1539 | ** mount options |
1521 | */ | 1540 | */ |
1522 | if (reiserfs_rupasov_hash(s) && code != YURA_HASH) { | 1541 | if (reiserfs_rupasov_hash(s) && code != YURA_HASH) { |
1523 | reiserfs_warning(s, "Error, %s hash detected, " | 1542 | reiserfs_warning(s, "reiserfs-2507", |
1543 | "Error, %s hash detected, " | ||
1524 | "unable to force rupasov hash", | 1544 | "unable to force rupasov hash", |
1525 | reiserfs_hashname(code)); | 1545 | reiserfs_hashname(code)); |
1526 | code = UNSET_HASH; | 1546 | code = UNSET_HASH; |
1527 | } else if (reiserfs_tea_hash(s) && code != TEA_HASH) { | 1547 | } else if (reiserfs_tea_hash(s) && code != TEA_HASH) { |
1528 | reiserfs_warning(s, "Error, %s hash detected, " | 1548 | reiserfs_warning(s, "reiserfs-2508", |
1549 | "Error, %s hash detected, " | ||
1529 | "unable to force tea hash", | 1550 | "unable to force tea hash", |
1530 | reiserfs_hashname(code)); | 1551 | reiserfs_hashname(code)); |
1531 | code = UNSET_HASH; | 1552 | code = UNSET_HASH; |
1532 | } else if (reiserfs_r5_hash(s) && code != R5_HASH) { | 1553 | } else if (reiserfs_r5_hash(s) && code != R5_HASH) { |
1533 | reiserfs_warning(s, "Error, %s hash detected, " | 1554 | reiserfs_warning(s, "reiserfs-2509", |
1555 | "Error, %s hash detected, " | ||
1534 | "unable to force r5 hash", | 1556 | "unable to force r5 hash", |
1535 | reiserfs_hashname(code)); | 1557 | reiserfs_hashname(code)); |
1536 | code = UNSET_HASH; | 1558 | code = UNSET_HASH; |
@@ -1589,9 +1611,9 @@ static int function2code(hashf_t func) | |||
1589 | return 0; | 1611 | return 0; |
1590 | } | 1612 | } |
1591 | 1613 | ||
1592 | #define SWARN(silent, s, ...) \ | 1614 | #define SWARN(silent, s, id, ...) \ |
1593 | if (!(silent)) \ | 1615 | if (!(silent)) \ |
1594 | reiserfs_warning (s, __VA_ARGS__) | 1616 | reiserfs_warning(s, id, __VA_ARGS__) |
1595 | 1617 | ||
1596 | static int reiserfs_fill_super(struct super_block *s, void *data, int silent) | 1618 | static int reiserfs_fill_super(struct super_block *s, void *data, int silent) |
1597 | { | 1619 | { |
@@ -1643,8 +1665,7 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent) | |||
1643 | #endif | 1665 | #endif |
1644 | 1666 | ||
1645 | if (blocks) { | 1667 | if (blocks) { |
1646 | SWARN(silent, s, "jmacd-7: reiserfs_fill_super: resize option " | 1668 | SWARN(silent, s, "jmacd-7", "resize option for remount only"); |
1647 | "for remount only"); | ||
1648 | goto error; | 1669 | goto error; |
1649 | } | 1670 | } |
1650 | 1671 | ||
@@ -1653,8 +1674,7 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent) | |||
1653 | old_format = 1; | 1674 | old_format = 1; |
1654 | /* try new format (64-th 1k block), which can contain reiserfs super block */ | 1675 | /* try new format (64-th 1k block), which can contain reiserfs super block */ |
1655 | else if (read_super_block(s, REISERFS_DISK_OFFSET_IN_BYTES)) { | 1676 | else if (read_super_block(s, REISERFS_DISK_OFFSET_IN_BYTES)) { |
1656 | SWARN(silent, s, | 1677 | SWARN(silent, s, "sh-2021", "can not find reiserfs on %s", |
1657 | "sh-2021: reiserfs_fill_super: can not find reiserfs on %s", | ||
1658 | reiserfs_bdevname(s)); | 1678 | reiserfs_bdevname(s)); |
1659 | goto error; | 1679 | goto error; |
1660 | } | 1680 | } |
@@ -1666,13 +1686,12 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent) | |||
1666 | if (s->s_bdev && s->s_bdev->bd_inode | 1686 | if (s->s_bdev && s->s_bdev->bd_inode |
1667 | && i_size_read(s->s_bdev->bd_inode) < | 1687 | && i_size_read(s->s_bdev->bd_inode) < |
1668 | sb_block_count(rs) * sb_blocksize(rs)) { | 1688 | sb_block_count(rs) * sb_blocksize(rs)) { |
1669 | SWARN(silent, s, | 1689 | SWARN(silent, s, "", "Filesystem cannot be " |
1670 | "Filesystem on %s cannot be mounted because it is bigger than the device", | 1690 | "mounted because it is bigger than the device"); |
1671 | reiserfs_bdevname(s)); | 1691 | SWARN(silent, s, "", "You may need to run fsck " |
1672 | SWARN(silent, s, | 1692 | "or increase size of your LVM partition"); |
1673 | "You may need to run fsck or increase size of your LVM partition"); | 1693 | SWARN(silent, s, "", "Or may be you forgot to " |
1674 | SWARN(silent, s, | 1694 | "reboot after fdisk when it told you to"); |
1675 | "Or may be you forgot to reboot after fdisk when it told you to"); | ||
1676 | goto error; | 1695 | goto error; |
1677 | } | 1696 | } |
1678 | 1697 | ||
@@ -1680,14 +1699,13 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent) | |||
1680 | sbi->s_mount_state = REISERFS_VALID_FS; | 1699 | sbi->s_mount_state = REISERFS_VALID_FS; |
1681 | 1700 | ||
1682 | if ((errval = reiserfs_init_bitmap_cache(s))) { | 1701 | if ((errval = reiserfs_init_bitmap_cache(s))) { |
1683 | SWARN(silent, s, | 1702 | SWARN(silent, s, "jmacd-8", "unable to read bitmap"); |
1684 | "jmacd-8: reiserfs_fill_super: unable to read bitmap"); | ||
1685 | goto error; | 1703 | goto error; |
1686 | } | 1704 | } |
1687 | errval = -EINVAL; | 1705 | errval = -EINVAL; |
1688 | #ifdef CONFIG_REISERFS_CHECK | 1706 | #ifdef CONFIG_REISERFS_CHECK |
1689 | SWARN(silent, s, "CONFIG_REISERFS_CHECK is set ON"); | 1707 | SWARN(silent, s, "", "CONFIG_REISERFS_CHECK is set ON"); |
1690 | SWARN(silent, s, "- it is slow mode for debugging."); | 1708 | SWARN(silent, s, "", "- it is slow mode for debugging."); |
1691 | #endif | 1709 | #endif |
1692 | 1710 | ||
1693 | /* make data=ordered the default */ | 1711 | /* make data=ordered the default */ |
@@ -1708,8 +1726,8 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent) | |||
1708 | } | 1726 | } |
1709 | // set_device_ro(s->s_dev, 1) ; | 1727 | // set_device_ro(s->s_dev, 1) ; |
1710 | if (journal_init(s, jdev_name, old_format, commit_max_age)) { | 1728 | if (journal_init(s, jdev_name, old_format, commit_max_age)) { |
1711 | SWARN(silent, s, | 1729 | SWARN(silent, s, "sh-2022", |
1712 | "sh-2022: reiserfs_fill_super: unable to initialize journal space"); | 1730 | "unable to initialize journal space"); |
1713 | goto error; | 1731 | goto error; |
1714 | } else { | 1732 | } else { |
1715 | jinit_done = 1; /* once this is set, journal_release must be called | 1733 | jinit_done = 1; /* once this is set, journal_release must be called |
@@ -1717,8 +1735,8 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent) | |||
1717 | */ | 1735 | */ |
1718 | } | 1736 | } |
1719 | if (reread_meta_blocks(s)) { | 1737 | if (reread_meta_blocks(s)) { |
1720 | SWARN(silent, s, | 1738 | SWARN(silent, s, "jmacd-9", |
1721 | "jmacd-9: reiserfs_fill_super: unable to reread meta blocks after journal init"); | 1739 | "unable to reread meta blocks after journal init"); |
1722 | goto error; | 1740 | goto error; |
1723 | } | 1741 | } |
1724 | 1742 | ||
@@ -1726,8 +1744,8 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent) | |||
1726 | goto error; | 1744 | goto error; |
1727 | 1745 | ||
1728 | if (bdev_read_only(s->s_bdev) && !(s->s_flags & MS_RDONLY)) { | 1746 | if (bdev_read_only(s->s_bdev) && !(s->s_flags & MS_RDONLY)) { |
1729 | SWARN(silent, s, | 1747 | SWARN(silent, s, "clm-7000", |
1730 | "clm-7000: Detected readonly device, marking FS readonly"); | 1748 | "Detected readonly device, marking FS readonly"); |
1731 | s->s_flags |= MS_RDONLY; | 1749 | s->s_flags |= MS_RDONLY; |
1732 | } | 1750 | } |
1733 | args.objectid = REISERFS_ROOT_OBJECTID; | 1751 | args.objectid = REISERFS_ROOT_OBJECTID; |
@@ -1736,8 +1754,7 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent) | |||
1736 | iget5_locked(s, REISERFS_ROOT_OBJECTID, reiserfs_find_actor, | 1754 | iget5_locked(s, REISERFS_ROOT_OBJECTID, reiserfs_find_actor, |
1737 | reiserfs_init_locked_inode, (void *)(&args)); | 1755 | reiserfs_init_locked_inode, (void *)(&args)); |
1738 | if (!root_inode) { | 1756 | if (!root_inode) { |
1739 | SWARN(silent, s, | 1757 | SWARN(silent, s, "jmacd-10", "get root inode failed"); |
1740 | "jmacd-10: reiserfs_fill_super: get root inode failed"); | ||
1741 | goto error; | 1758 | goto error; |
1742 | } | 1759 | } |
1743 | 1760 | ||
@@ -1786,7 +1803,7 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent) | |||
1786 | * avoiding corruption. -jeffm */ | 1803 | * avoiding corruption. -jeffm */ |
1787 | if (bmap_would_wrap(reiserfs_bmap_count(s)) && | 1804 | if (bmap_would_wrap(reiserfs_bmap_count(s)) && |
1788 | sb_bmap_nr(rs) != 0) { | 1805 | sb_bmap_nr(rs) != 0) { |
1789 | reiserfs_warning(s, "super-2030: This file system " | 1806 | reiserfs_warning(s, "super-2030", "This file system " |
1790 | "claims to use %u bitmap blocks in " | 1807 | "claims to use %u bitmap blocks in " |
1791 | "its super block, but requires %u. " | 1808 | "its super block, but requires %u. " |
1792 | "Clearing to zero.", sb_bmap_nr(rs), | 1809 | "Clearing to zero.", sb_bmap_nr(rs), |
@@ -2087,8 +2104,8 @@ static int reiserfs_quota_on(struct super_block *sb, int type, int format_id, | |||
2087 | if (!(REISERFS_I(inode)->i_flags & i_nopack_mask)) { | 2104 | if (!(REISERFS_I(inode)->i_flags & i_nopack_mask)) { |
2088 | err = reiserfs_unpack(inode, NULL); | 2105 | err = reiserfs_unpack(inode, NULL); |
2089 | if (err) { | 2106 | if (err) { |
2090 | reiserfs_warning(sb, | 2107 | reiserfs_warning(sb, "super-6520", |
2091 | "reiserfs: Unpacking tail of quota file failed" | 2108 | "Unpacking tail of quota file failed" |
2092 | " (%d). Cannot turn on quotas.", err); | 2109 | " (%d). Cannot turn on quotas.", err); |
2093 | err = -EINVAL; | 2110 | err = -EINVAL; |
2094 | goto out; | 2111 | goto out; |
@@ -2099,8 +2116,8 @@ static int reiserfs_quota_on(struct super_block *sb, int type, int format_id, | |||
2099 | if (REISERFS_SB(sb)->s_qf_names[type]) { | 2116 | if (REISERFS_SB(sb)->s_qf_names[type]) { |
2100 | /* Quotafile not of fs root? */ | 2117 | /* Quotafile not of fs root? */ |
2101 | if (path.dentry->d_parent != sb->s_root) | 2118 | if (path.dentry->d_parent != sb->s_root) |
2102 | reiserfs_warning(sb, | 2119 | reiserfs_warning(sb, "super-6521", |
2103 | "reiserfs: Quota file not on filesystem root. " | 2120 | "Quota file not on filesystem root. " |
2104 | "Journalled quota will not work."); | 2121 | "Journalled quota will not work."); |
2105 | } | 2122 | } |
2106 | 2123 | ||