aboutsummaryrefslogtreecommitdiffstats
path: root/fs/reiserfs/super.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/reiserfs/super.c')
-rw-r--r--fs/reiserfs/super.c363
1 files changed, 158 insertions, 205 deletions
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
index f3c820b75829..972250c62896 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,17 +195,16 @@ 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_error(s, "vs-2140",
199 "vs-2140: finish_unfinished: search_by_key returned %d", 199 "search_by_key returned %d", retval);
200 retval);
201 break; 200 break;
202 } 201 }
203 202
204 bh = get_last_bh(&path); 203 bh = get_last_bh(&path);
205 item_pos = get_item_pos(&path); 204 item_pos = get_item_pos(&path);
206 if (item_pos != B_NR_ITEMS(bh)) { 205 if (item_pos != B_NR_ITEMS(bh)) {
207 reiserfs_warning(s, 206 reiserfs_warning(s, "vs-2060",
208 "vs-2060: finish_unfinished: wrong position found"); 207 "wrong position found");
209 break; 208 break;
210 } 209 }
211 item_pos--; 210 item_pos--;
@@ -235,8 +234,7 @@ static int finish_unfinished(struct super_block *s)
235 if (!inode) { 234 if (!inode) {
236 /* the unlink almost completed, it just did not manage to remove 235 /* the unlink almost completed, it just did not manage to remove
237 "save" link and release objectid */ 236 "save" link and release objectid */
238 reiserfs_warning(s, 237 reiserfs_warning(s, "vs-2180", "iget failed for %K",
239 "vs-2180: finish_unfinished: iget failed for %K",
240 &obj_key); 238 &obj_key);
241 retval = remove_save_link_only(s, &save_link_key, 1); 239 retval = remove_save_link_only(s, &save_link_key, 1);
242 continue; 240 continue;
@@ -244,21 +242,22 @@ static int finish_unfinished(struct super_block *s)
244 242
245 if (!truncate && inode->i_nlink) { 243 if (!truncate && inode->i_nlink) {
246 /* file is not unlinked */ 244 /* file is not unlinked */
247 reiserfs_warning(s, 245 reiserfs_warning(s, "vs-2185",
248 "vs-2185: finish_unfinished: file %K is not unlinked", 246 "file %K is not unlinked",
249 &obj_key); 247 &obj_key);
250 retval = remove_save_link_only(s, &save_link_key, 0); 248 retval = remove_save_link_only(s, &save_link_key, 0);
251 continue; 249 continue;
252 } 250 }
253 DQUOT_INIT(inode); 251 vfs_dq_init(inode);
254 252
255 if (truncate && S_ISDIR(inode->i_mode)) { 253 if (truncate && S_ISDIR(inode->i_mode)) {
256 /* We got a truncate request for a dir which is impossible. 254 /* We got a truncate request for a dir which is impossible.
257 The only imaginable way is to execute unfinished truncate request 255 The only imaginable way is to execute unfinished truncate request
258 then boot into old kernel, remove the file and create dir with 256 then boot into old kernel, remove the file and create dir with
259 the same key. */ 257 the same key. */
260 reiserfs_warning(s, 258 reiserfs_warning(s, "green-2101",
261 "green-2101: impossible truncate on a directory %k. Please report", 259 "impossible truncate on a "
260 "directory %k. Please report",
262 INODE_PKEY(inode)); 261 INODE_PKEY(inode));
263 retval = remove_save_link_only(s, &save_link_key, 0); 262 retval = remove_save_link_only(s, &save_link_key, 0);
264 truncate = 0; 263 truncate = 0;
@@ -288,9 +287,10 @@ static int finish_unfinished(struct super_block *s)
288 /* removal gets completed in iput */ 287 /* removal gets completed in iput */
289 retval = 0; 288 retval = 0;
290 } else { 289 } else {
291 reiserfs_warning(s, "Dead loop in " 290 reiserfs_warning(s, "super-2189", "Dead loop "
292 "finish_unfinished detected, " 291 "in finish_unfinished "
293 "just remove save link\n"); 292 "detected, just remove "
293 "save link\n");
294 retval = remove_save_link_only(s, 294 retval = remove_save_link_only(s,
295 &save_link_key, 0); 295 &save_link_key, 0);
296 } 296 }
@@ -360,8 +360,9 @@ void add_save_link(struct reiserfs_transaction_handle *th,
360 } else { 360 } else {
361 /* truncate */ 361 /* truncate */
362 if (S_ISDIR(inode->i_mode)) 362 if (S_ISDIR(inode->i_mode))
363 reiserfs_warning(inode->i_sb, 363 reiserfs_warning(inode->i_sb, "green-2102",
364 "green-2102: Adding a truncate savelink for a directory %k! Please report", 364 "Adding a truncate savelink for "
365 "a directory %k! Please report",
365 INODE_PKEY(inode)); 366 INODE_PKEY(inode));
366 set_cpu_key_k_offset(&key, 1); 367 set_cpu_key_k_offset(&key, 1);
367 set_cpu_key_k_type(&key, TYPE_INDIRECT); 368 set_cpu_key_k_type(&key, TYPE_INDIRECT);
@@ -376,9 +377,9 @@ void add_save_link(struct reiserfs_transaction_handle *th,
376 retval = search_item(inode->i_sb, &key, &path); 377 retval = search_item(inode->i_sb, &key, &path);
377 if (retval != ITEM_NOT_FOUND) { 378 if (retval != ITEM_NOT_FOUND) {
378 if (retval != -ENOSPC) 379 if (retval != -ENOSPC)
379 reiserfs_warning(inode->i_sb, "vs-2100: add_save_link:" 380 reiserfs_error(inode->i_sb, "vs-2100",
380 "search_by_key (%K) returned %d", &key, 381 "search_by_key (%K) returned %d", &key,
381 retval); 382 retval);
382 pathrelse(&path); 383 pathrelse(&path);
383 return; 384 return;
384 } 385 }
@@ -391,9 +392,8 @@ void add_save_link(struct reiserfs_transaction_handle *th,
391 reiserfs_insert_item(th, &path, &key, &ih, NULL, (char *)&link); 392 reiserfs_insert_item(th, &path, &key, &ih, NULL, (char *)&link);
392 if (retval) { 393 if (retval) {
393 if (retval != -ENOSPC) 394 if (retval != -ENOSPC)
394 reiserfs_warning(inode->i_sb, 395 reiserfs_error(inode->i_sb, "vs-2120",
395 "vs-2120: add_save_link: insert_item returned %d", 396 "insert_item returned %d", retval);
396 retval);
397 } else { 397 } else {
398 if (truncate) 398 if (truncate)
399 REISERFS_I(inode)->i_flags |= 399 REISERFS_I(inode)->i_flags |=
@@ -492,8 +492,7 @@ static void reiserfs_put_super(struct super_block *s)
492 print_statistics(s); 492 print_statistics(s);
493 493
494 if (REISERFS_SB(s)->reserved_blocks != 0) { 494 if (REISERFS_SB(s)->reserved_blocks != 0) {
495 reiserfs_warning(s, 495 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); 496 REISERFS_SB(s)->reserved_blocks);
498 } 497 }
499 498
@@ -559,8 +558,8 @@ static void reiserfs_dirty_inode(struct inode *inode)
559 558
560 int err = 0; 559 int err = 0;
561 if (inode->i_sb->s_flags & MS_RDONLY) { 560 if (inode->i_sb->s_flags & MS_RDONLY) {
562 reiserfs_warning(inode->i_sb, 561 reiserfs_warning(inode->i_sb, "clm-6006",
563 "clm-6006: writing inode %lu on readonly FS", 562 "writing inode %lu on readonly FS",
564 inode->i_ino); 563 inode->i_ino);
565 return; 564 return;
566 } 565 }
@@ -629,8 +628,6 @@ static const struct super_operations reiserfs_sops = {
629#ifdef CONFIG_QUOTA 628#ifdef CONFIG_QUOTA
630#define QTYPE2NAME(t) ((t)==USRQUOTA?"user":"group") 629#define QTYPE2NAME(t) ((t)==USRQUOTA?"user":"group")
631 630
632static int reiserfs_dquot_initialize(struct inode *, int);
633static int reiserfs_dquot_drop(struct inode *);
634static int reiserfs_write_dquot(struct dquot *); 631static int reiserfs_write_dquot(struct dquot *);
635static int reiserfs_acquire_dquot(struct dquot *); 632static int reiserfs_acquire_dquot(struct dquot *);
636static int reiserfs_release_dquot(struct dquot *); 633static int reiserfs_release_dquot(struct dquot *);
@@ -639,8 +636,8 @@ static int reiserfs_write_info(struct super_block *, int);
639static int reiserfs_quota_on(struct super_block *, int, int, char *, int); 636static int reiserfs_quota_on(struct super_block *, int, int, char *, int);
640 637
641static struct dquot_operations reiserfs_quota_operations = { 638static struct dquot_operations reiserfs_quota_operations = {
642 .initialize = reiserfs_dquot_initialize, 639 .initialize = dquot_initialize,
643 .drop = reiserfs_dquot_drop, 640 .drop = dquot_drop,
644 .alloc_space = dquot_alloc_space, 641 .alloc_space = dquot_alloc_space,
645 .alloc_inode = dquot_alloc_inode, 642 .alloc_inode = dquot_alloc_inode,
646 .free_space = dquot_free_space, 643 .free_space = dquot_free_space,
@@ -759,7 +756,7 @@ static int reiserfs_getopt(struct super_block *s, char **cur, opt_desc_t * opts,
759 char **opt_arg, unsigned long *bit_flags) 756 char **opt_arg, unsigned long *bit_flags)
760{ 757{
761 char *p; 758 char *p;
762 /* foo=bar, 759 /* foo=bar,
763 ^ ^ ^ 760 ^ ^ ^
764 | | +-- option_end 761 | | +-- option_end
765 | +-- arg_start 762 | +-- arg_start
@@ -794,13 +791,15 @@ static int reiserfs_getopt(struct super_block *s, char **cur, opt_desc_t * opts,
794 if (bit_flags) { 791 if (bit_flags) {
795 if (opt->clrmask == 792 if (opt->clrmask ==
796 (1 << REISERFS_UNSUPPORTED_OPT)) 793 (1 << REISERFS_UNSUPPORTED_OPT))
797 reiserfs_warning(s, "%s not supported.", 794 reiserfs_warning(s, "super-6500",
795 "%s not supported.\n",
798 p); 796 p);
799 else 797 else
800 *bit_flags &= ~opt->clrmask; 798 *bit_flags &= ~opt->clrmask;
801 if (opt->setmask == 799 if (opt->setmask ==
802 (1 << REISERFS_UNSUPPORTED_OPT)) 800 (1 << REISERFS_UNSUPPORTED_OPT))
803 reiserfs_warning(s, "%s not supported.", 801 reiserfs_warning(s, "super-6501",
802 "%s not supported.\n",
804 p); 803 p);
805 else 804 else
806 *bit_flags |= opt->setmask; 805 *bit_flags |= opt->setmask;
@@ -809,7 +808,8 @@ static int reiserfs_getopt(struct super_block *s, char **cur, opt_desc_t * opts,
809 } 808 }
810 } 809 }
811 if (!opt->option_name) { 810 if (!opt->option_name) {
812 reiserfs_warning(s, "unknown mount option \"%s\"", p); 811 reiserfs_warning(s, "super-6502",
812 "unknown mount option \"%s\"", p);
813 return -1; 813 return -1;
814 } 814 }
815 815
@@ -817,8 +817,9 @@ static int reiserfs_getopt(struct super_block *s, char **cur, opt_desc_t * opts,
817 switch (*p) { 817 switch (*p) {
818 case '=': 818 case '=':
819 if (!opt->arg_required) { 819 if (!opt->arg_required) {
820 reiserfs_warning(s, 820 reiserfs_warning(s, "super-6503",
821 "the option \"%s\" does not require an argument", 821 "the option \"%s\" does not "
822 "require an argument\n",
822 opt->option_name); 823 opt->option_name);
823 return -1; 824 return -1;
824 } 825 }
@@ -826,14 +827,15 @@ static int reiserfs_getopt(struct super_block *s, char **cur, opt_desc_t * opts,
826 827
827 case 0: 828 case 0:
828 if (opt->arg_required) { 829 if (opt->arg_required) {
829 reiserfs_warning(s, 830 reiserfs_warning(s, "super-6504",
830 "the option \"%s\" requires an argument", 831 "the option \"%s\" requires an "
831 opt->option_name); 832 "argument\n", opt->option_name);
832 return -1; 833 return -1;
833 } 834 }
834 break; 835 break;
835 default: 836 default:
836 reiserfs_warning(s, "head of option \"%s\" is only correct", 837 reiserfs_warning(s, "super-6505",
838 "head of option \"%s\" is only correct\n",
837 opt->option_name); 839 opt->option_name);
838 return -1; 840 return -1;
839 } 841 }
@@ -845,7 +847,8 @@ static int reiserfs_getopt(struct super_block *s, char **cur, opt_desc_t * opts,
845 && !(opt->arg_required & (1 << REISERFS_OPT_ALLOWEMPTY)) 847 && !(opt->arg_required & (1 << REISERFS_OPT_ALLOWEMPTY))
846 && !strlen(p)) { 848 && !strlen(p)) {
847 /* this catches "option=," if not allowed */ 849 /* this catches "option=," if not allowed */
848 reiserfs_warning(s, "empty argument for \"%s\"", 850 reiserfs_warning(s, "super-6506",
851 "empty argument for \"%s\"\n",
849 opt->option_name); 852 opt->option_name);
850 return -1; 853 return -1;
851 } 854 }
@@ -867,7 +870,8 @@ static int reiserfs_getopt(struct super_block *s, char **cur, opt_desc_t * opts,
867 } 870 }
868 } 871 }
869 872
870 reiserfs_warning(s, "bad value \"%s\" for option \"%s\"", p, 873 reiserfs_warning(s, "super-6506",
874 "bad value \"%s\" for option \"%s\"\n", p,
871 opt->option_name); 875 opt->option_name);
872 return -1; 876 return -1;
873} 877}
@@ -957,9 +961,9 @@ static int reiserfs_parse_options(struct super_block *s, char *options, /* strin
957 *blocks = simple_strtoul(arg, &p, 0); 961 *blocks = simple_strtoul(arg, &p, 0);
958 if (*p != '\0') { 962 if (*p != '\0') {
959 /* NNN does not look like a number */ 963 /* NNN does not look like a number */
960 reiserfs_warning(s, 964 reiserfs_warning(s, "super-6507",
961 "reiserfs_parse_options: bad value %s", 965 "bad value %s for "
962 arg); 966 "-oresize\n", arg);
963 return 0; 967 return 0;
964 } 968 }
965 } 969 }
@@ -970,8 +974,8 @@ static int reiserfs_parse_options(struct super_block *s, char *options, /* strin
970 unsigned long val = simple_strtoul(arg, &p, 0); 974 unsigned long val = simple_strtoul(arg, &p, 0);
971 /* commit=NNN (time in seconds) */ 975 /* commit=NNN (time in seconds) */
972 if (*p != '\0' || val >= (unsigned int)-1) { 976 if (*p != '\0' || val >= (unsigned int)-1) {
973 reiserfs_warning(s, 977 reiserfs_warning(s, "super-6508",
974 "reiserfs_parse_options: bad value %s", 978 "bad value %s for -ocommit\n",
975 arg); 979 arg);
976 return 0; 980 return 0;
977 } 981 }
@@ -979,16 +983,18 @@ static int reiserfs_parse_options(struct super_block *s, char *options, /* strin
979 } 983 }
980 984
981 if (c == 'w') { 985 if (c == 'w') {
982 reiserfs_warning(s, "reiserfs: nolargeio option is no longer supported"); 986 reiserfs_warning(s, "super-6509", "nolargeio option "
987 "is no longer supported");
983 return 0; 988 return 0;
984 } 989 }
985 990
986 if (c == 'j') { 991 if (c == 'j') {
987 if (arg && *arg && jdev_name) { 992 if (arg && *arg && jdev_name) {
988 if (*jdev_name) { //Hm, already assigned? 993 if (*jdev_name) { //Hm, already assigned?
989 reiserfs_warning(s, 994 reiserfs_warning(s, "super-6510",
990 "reiserfs_parse_options: journal device was already specified to be %s", 995 "journal device was "
991 *jdev_name); 996 "already specified to "
997 "be %s", *jdev_name);
992 return 0; 998 return 0;
993 } 999 }
994 *jdev_name = arg; 1000 *jdev_name = arg;
@@ -1000,29 +1006,35 @@ static int reiserfs_parse_options(struct super_block *s, char *options, /* strin
1000 1006
1001 if (sb_any_quota_loaded(s) && 1007 if (sb_any_quota_loaded(s) &&
1002 (!*arg != !REISERFS_SB(s)->s_qf_names[qtype])) { 1008 (!*arg != !REISERFS_SB(s)->s_qf_names[qtype])) {
1003 reiserfs_warning(s, 1009 reiserfs_warning(s, "super-6511",
1004 "reiserfs_parse_options: cannot change journaled quota options when quota turned on."); 1010 "cannot change journaled "
1011 "quota options when quota "
1012 "turned on.");
1005 return 0; 1013 return 0;
1006 } 1014 }
1007 if (*arg) { /* Some filename specified? */ 1015 if (*arg) { /* Some filename specified? */
1008 if (REISERFS_SB(s)->s_qf_names[qtype] 1016 if (REISERFS_SB(s)->s_qf_names[qtype]
1009 && strcmp(REISERFS_SB(s)->s_qf_names[qtype], 1017 && strcmp(REISERFS_SB(s)->s_qf_names[qtype],
1010 arg)) { 1018 arg)) {
1011 reiserfs_warning(s, 1019 reiserfs_warning(s, "super-6512",
1012 "reiserfs_parse_options: %s quota file already specified.", 1020 "%s quota file "
1021 "already specified.",
1013 QTYPE2NAME(qtype)); 1022 QTYPE2NAME(qtype));
1014 return 0; 1023 return 0;
1015 } 1024 }
1016 if (strchr(arg, '/')) { 1025 if (strchr(arg, '/')) {
1017 reiserfs_warning(s, 1026 reiserfs_warning(s, "super-6513",
1018 "reiserfs_parse_options: quotafile must be on filesystem root."); 1027 "quotafile must be "
1028 "on filesystem root.");
1019 return 0; 1029 return 0;
1020 } 1030 }
1021 qf_names[qtype] = 1031 qf_names[qtype] =
1022 kmalloc(strlen(arg) + 1, GFP_KERNEL); 1032 kmalloc(strlen(arg) + 1, GFP_KERNEL);
1023 if (!qf_names[qtype]) { 1033 if (!qf_names[qtype]) {
1024 reiserfs_warning(s, 1034 reiserfs_warning(s, "reiserfs-2502",
1025 "reiserfs_parse_options: not enough memory for storing quotafile name."); 1035 "not enough memory "
1036 "for storing "
1037 "quotafile name.");
1026 return 0; 1038 return 0;
1027 } 1039 }
1028 strcpy(qf_names[qtype], arg); 1040 strcpy(qf_names[qtype], arg);
@@ -1040,21 +1052,24 @@ static int reiserfs_parse_options(struct super_block *s, char *options, /* strin
1040 else if (!strcmp(arg, "vfsv0")) 1052 else if (!strcmp(arg, "vfsv0"))
1041 *qfmt = QFMT_VFS_V0; 1053 *qfmt = QFMT_VFS_V0;
1042 else { 1054 else {
1043 reiserfs_warning(s, 1055 reiserfs_warning(s, "super-6514",
1044 "reiserfs_parse_options: unknown quota format specified."); 1056 "unknown quota format "
1057 "specified.");
1045 return 0; 1058 return 0;
1046 } 1059 }
1047 if (sb_any_quota_loaded(s) && 1060 if (sb_any_quota_loaded(s) &&
1048 *qfmt != REISERFS_SB(s)->s_jquota_fmt) { 1061 *qfmt != REISERFS_SB(s)->s_jquota_fmt) {
1049 reiserfs_warning(s, 1062 reiserfs_warning(s, "super-6515",
1050 "reiserfs_parse_options: cannot change journaled quota options when quota turned on."); 1063 "cannot change journaled "
1064 "quota options when quota "
1065 "turned on.");
1051 return 0; 1066 return 0;
1052 } 1067 }
1053 } 1068 }
1054#else 1069#else
1055 if (c == 'u' || c == 'g' || c == 'f') { 1070 if (c == 'u' || c == 'g' || c == 'f') {
1056 reiserfs_warning(s, 1071 reiserfs_warning(s, "reiserfs-2503", "journaled "
1057 "reiserfs_parse_options: journaled quota options not supported."); 1072 "quota options not supported.");
1058 return 0; 1073 return 0;
1059 } 1074 }
1060#endif 1075#endif
@@ -1063,15 +1078,15 @@ static int reiserfs_parse_options(struct super_block *s, char *options, /* strin
1063#ifdef CONFIG_QUOTA 1078#ifdef CONFIG_QUOTA
1064 if (!REISERFS_SB(s)->s_jquota_fmt && !*qfmt 1079 if (!REISERFS_SB(s)->s_jquota_fmt && !*qfmt
1065 && (qf_names[USRQUOTA] || qf_names[GRPQUOTA])) { 1080 && (qf_names[USRQUOTA] || qf_names[GRPQUOTA])) {
1066 reiserfs_warning(s, 1081 reiserfs_warning(s, "super-6515",
1067 "reiserfs_parse_options: journaled quota format not specified."); 1082 "journaled quota format not specified.");
1068 return 0; 1083 return 0;
1069 } 1084 }
1070 /* This checking is not precise wrt the quota type but for our purposes it is sufficient */ 1085 /* This checking is not precise wrt the quota type but for our purposes it is sufficient */
1071 if (!(*mount_options & (1 << REISERFS_QUOTA)) 1086 if (!(*mount_options & (1 << REISERFS_QUOTA))
1072 && sb_any_quota_loaded(s)) { 1087 && sb_any_quota_loaded(s)) {
1073 reiserfs_warning(s, 1088 reiserfs_warning(s, "super-6516", "quota options must "
1074 "reiserfs_parse_options: quota options must be present when quota is turned on."); 1089 "be present when quota is turned on.");
1075 return 0; 1090 return 0;
1076 } 1091 }
1077#endif 1092#endif
@@ -1131,14 +1146,15 @@ static void handle_attrs(struct super_block *s)
1131 1146
1132 if (reiserfs_attrs(s)) { 1147 if (reiserfs_attrs(s)) {
1133 if (old_format_only(s)) { 1148 if (old_format_only(s)) {
1134 reiserfs_warning(s, 1149 reiserfs_warning(s, "super-6517", "cannot support "
1135 "reiserfs: cannot support attributes on 3.5.x disk format"); 1150 "attributes on 3.5.x disk format");
1136 REISERFS_SB(s)->s_mount_opt &= ~(1 << REISERFS_ATTRS); 1151 REISERFS_SB(s)->s_mount_opt &= ~(1 << REISERFS_ATTRS);
1137 return; 1152 return;
1138 } 1153 }
1139 if (!(le32_to_cpu(rs->s_flags) & reiserfs_attrs_cleared)) { 1154 if (!(le32_to_cpu(rs->s_flags) & reiserfs_attrs_cleared)) {
1140 reiserfs_warning(s, 1155 reiserfs_warning(s, "super-6518", "cannot support "
1141 "reiserfs: cannot support attributes until flag is set in super-block"); 1156 "attributes until flag is set in "
1157 "super-block");
1142 REISERFS_SB(s)->s_mount_opt &= ~(1 << REISERFS_ATTRS); 1158 REISERFS_SB(s)->s_mount_opt &= ~(1 << REISERFS_ATTRS);
1143 } 1159 }
1144 } 1160 }
@@ -1280,6 +1296,8 @@ static int reiserfs_remount(struct super_block *s, int *mount_flags, char *arg)
1280 REISERFS_SB(s)->s_mount_state = sb_umount_state(rs); 1296 REISERFS_SB(s)->s_mount_state = sb_umount_state(rs);
1281 s->s_flags &= ~MS_RDONLY; 1297 s->s_flags &= ~MS_RDONLY;
1282 set_sb_umount_state(rs, REISERFS_ERROR_FS); 1298 set_sb_umount_state(rs, REISERFS_ERROR_FS);
1299 if (!old_format_only(s))
1300 set_sb_mnt_count(rs, sb_mnt_count(rs) + 1);
1283 /* mark_buffer_dirty (SB_BUFFER_WITH_SB (s), 1); */ 1301 /* mark_buffer_dirty (SB_BUFFER_WITH_SB (s), 1); */
1284 journal_mark_dirty(&th, s, SB_BUFFER_WITH_SB(s)); 1302 journal_mark_dirty(&th, s, SB_BUFFER_WITH_SB(s));
1285 REISERFS_SB(s)->s_mount_state = REISERFS_VALID_FS; 1303 REISERFS_SB(s)->s_mount_state = REISERFS_VALID_FS;
@@ -1314,7 +1332,7 @@ static int read_super_block(struct super_block *s, int offset)
1314 1332
1315 bh = sb_bread(s, offset / s->s_blocksize); 1333 bh = sb_bread(s, offset / s->s_blocksize);
1316 if (!bh) { 1334 if (!bh) {
1317 reiserfs_warning(s, "sh-2006: read_super_block: " 1335 reiserfs_warning(s, "sh-2006",
1318 "bread failed (dev %s, block %lu, size %lu)", 1336 "bread failed (dev %s, block %lu, size %lu)",
1319 reiserfs_bdevname(s), offset / s->s_blocksize, 1337 reiserfs_bdevname(s), offset / s->s_blocksize,
1320 s->s_blocksize); 1338 s->s_blocksize);
@@ -1328,15 +1346,15 @@ static int read_super_block(struct super_block *s, int offset)
1328 } 1346 }
1329 // 1347 //
1330 // ok, reiserfs signature (old or new) found in at the given offset 1348 // ok, reiserfs signature (old or new) found in at the given offset
1331 // 1349 //
1332 fs_blocksize = sb_blocksize(rs); 1350 fs_blocksize = sb_blocksize(rs);
1333 brelse(bh); 1351 brelse(bh);
1334 sb_set_blocksize(s, fs_blocksize); 1352 sb_set_blocksize(s, fs_blocksize);
1335 1353
1336 bh = sb_bread(s, offset / s->s_blocksize); 1354 bh = sb_bread(s, offset / s->s_blocksize);
1337 if (!bh) { 1355 if (!bh) {
1338 reiserfs_warning(s, "sh-2007: read_super_block: " 1356 reiserfs_warning(s, "sh-2007",
1339 "bread failed (dev %s, block %lu, size %lu)\n", 1357 "bread failed (dev %s, block %lu, size %lu)",
1340 reiserfs_bdevname(s), offset / s->s_blocksize, 1358 reiserfs_bdevname(s), offset / s->s_blocksize,
1341 s->s_blocksize); 1359 s->s_blocksize);
1342 return 1; 1360 return 1;
@@ -1344,8 +1362,8 @@ static int read_super_block(struct super_block *s, int offset)
1344 1362
1345 rs = (struct reiserfs_super_block *)bh->b_data; 1363 rs = (struct reiserfs_super_block *)bh->b_data;
1346 if (sb_blocksize(rs) != s->s_blocksize) { 1364 if (sb_blocksize(rs) != s->s_blocksize) {
1347 reiserfs_warning(s, "sh-2011: read_super_block: " 1365 reiserfs_warning(s, "sh-2011", "can't find a reiserfs "
1348 "can't find a reiserfs filesystem on (dev %s, block %Lu, size %lu)\n", 1366 "filesystem on (dev %s, block %Lu, size %lu)",
1349 reiserfs_bdevname(s), 1367 reiserfs_bdevname(s),
1350 (unsigned long long)bh->b_blocknr, 1368 (unsigned long long)bh->b_blocknr,
1351 s->s_blocksize); 1369 s->s_blocksize);
@@ -1355,9 +1373,10 @@ static int read_super_block(struct super_block *s, int offset)
1355 1373
1356 if (rs->s_v1.s_root_block == cpu_to_le32(-1)) { 1374 if (rs->s_v1.s_root_block == cpu_to_le32(-1)) {
1357 brelse(bh); 1375 brelse(bh);
1358 reiserfs_warning(s, 1376 reiserfs_warning(s, "super-6519", "Unfinished reiserfsck "
1359 "Unfinished reiserfsck --rebuild-tree run detected. Please run\n" 1377 "--rebuild-tree run detected. Please run\n"
1360 "reiserfsck --rebuild-tree and wait for a completion. If that fails\n" 1378 "reiserfsck --rebuild-tree and wait for a "
1379 "completion. If that fails\n"
1361 "get newer reiserfsprogs package"); 1380 "get newer reiserfsprogs package");
1362 return 1; 1381 return 1;
1363 } 1382 }
@@ -1369,18 +1388,15 @@ static int read_super_block(struct super_block *s, int offset)
1369 /* magic is of non-standard journal filesystem, look at s_version to 1388 /* magic is of non-standard journal filesystem, look at s_version to
1370 find which format is in use */ 1389 find which format is in use */
1371 if (sb_version(rs) == REISERFS_VERSION_2) 1390 if (sb_version(rs) == REISERFS_VERSION_2)
1372 reiserfs_warning(s, 1391 reiserfs_info(s, "found reiserfs format \"3.6\""
1373 "read_super_block: found reiserfs format \"3.6\"" 1392 " with non-standard journal\n");
1374 " with non-standard journal");
1375 else if (sb_version(rs) == REISERFS_VERSION_1) 1393 else if (sb_version(rs) == REISERFS_VERSION_1)
1376 reiserfs_warning(s, 1394 reiserfs_info(s, "found reiserfs format \"3.5\""
1377 "read_super_block: found reiserfs format \"3.5\"" 1395 " with non-standard journal\n");
1378 " with non-standard journal");
1379 else { 1396 else {
1380 reiserfs_warning(s, 1397 reiserfs_warning(s, "sh-2012", "found unknown "
1381 "sh-2012: read_super_block: found unknown " 1398 "format \"%u\" of reiserfs with "
1382 "format \"%u\" of reiserfs with non-standard magic", 1399 "non-standard magic", sb_version(rs));
1383 sb_version(rs));
1384 return 1; 1400 return 1;
1385 } 1401 }
1386 } else 1402 } else
@@ -1410,8 +1426,7 @@ static int reread_meta_blocks(struct super_block *s)
1410 ll_rw_block(READ, 1, &(SB_BUFFER_WITH_SB(s))); 1426 ll_rw_block(READ, 1, &(SB_BUFFER_WITH_SB(s)));
1411 wait_on_buffer(SB_BUFFER_WITH_SB(s)); 1427 wait_on_buffer(SB_BUFFER_WITH_SB(s));
1412 if (!buffer_uptodate(SB_BUFFER_WITH_SB(s))) { 1428 if (!buffer_uptodate(SB_BUFFER_WITH_SB(s))) {
1413 reiserfs_warning(s, 1429 reiserfs_warning(s, "reiserfs-2504", "error reading the super");
1414 "reread_meta_blocks, error reading the super");
1415 return 1; 1430 return 1;
1416 } 1431 }
1417 1432
@@ -1454,8 +1469,8 @@ static __u32 find_hash_out(struct super_block *s)
1454 if (reiserfs_rupasov_hash(s)) { 1469 if (reiserfs_rupasov_hash(s)) {
1455 hash = YURA_HASH; 1470 hash = YURA_HASH;
1456 } 1471 }
1457 reiserfs_warning(s, "FS seems to be empty, autodetect " 1472 reiserfs_info(s, "FS seems to be empty, autodetect "
1458 "is using the default hash"); 1473 "is using the default hash\n");
1459 break; 1474 break;
1460 } 1475 }
1461 r5hash = GET_HASH_VALUE(r5_hash(de.de_name, de.de_namelen)); 1476 r5hash = GET_HASH_VALUE(r5_hash(de.de_name, de.de_namelen));
@@ -1475,10 +1490,10 @@ static __u32 find_hash_out(struct super_block *s)
1475 && (yurahash == 1490 && (yurahash ==
1476 GET_HASH_VALUE(deh_offset 1491 GET_HASH_VALUE(deh_offset
1477 (&(de.de_deh[de.de_entry_num])))))) { 1492 (&(de.de_deh[de.de_entry_num])))))) {
1478 reiserfs_warning(s, 1493 reiserfs_warning(s, "reiserfs-2506", "Unable to "
1479 "Unable to automatically detect hash function. " 1494 "automatically detect hash function. "
1480 "Please mount with -o hash={tea,rupasov,r5}", 1495 "Please mount with -o "
1481 reiserfs_bdevname(s)); 1496 "hash={tea,rupasov,r5}");
1482 hash = UNSET_HASH; 1497 hash = UNSET_HASH;
1483 break; 1498 break;
1484 } 1499 }
@@ -1492,7 +1507,8 @@ static __u32 find_hash_out(struct super_block *s)
1492 (deh_offset(&(de.de_deh[de.de_entry_num]))) == r5hash) 1507 (deh_offset(&(de.de_deh[de.de_entry_num]))) == r5hash)
1493 hash = R5_HASH; 1508 hash = R5_HASH;
1494 else { 1509 else {
1495 reiserfs_warning(s, "Unrecognised hash function"); 1510 reiserfs_warning(s, "reiserfs-2506",
1511 "Unrecognised hash function");
1496 hash = UNSET_HASH; 1512 hash = UNSET_HASH;
1497 } 1513 }
1498 } while (0); 1514 } while (0);
@@ -1516,21 +1532,24 @@ static int what_hash(struct super_block *s)
1516 code = find_hash_out(s); 1532 code = find_hash_out(s);
1517 1533
1518 if (code != UNSET_HASH && reiserfs_hash_detect(s)) { 1534 if (code != UNSET_HASH && reiserfs_hash_detect(s)) {
1519 /* detection has found the hash, and we must check against the 1535 /* detection has found the hash, and we must check against the
1520 ** mount options 1536 ** mount options
1521 */ 1537 */
1522 if (reiserfs_rupasov_hash(s) && code != YURA_HASH) { 1538 if (reiserfs_rupasov_hash(s) && code != YURA_HASH) {
1523 reiserfs_warning(s, "Error, %s hash detected, " 1539 reiserfs_warning(s, "reiserfs-2507",
1540 "Error, %s hash detected, "
1524 "unable to force rupasov hash", 1541 "unable to force rupasov hash",
1525 reiserfs_hashname(code)); 1542 reiserfs_hashname(code));
1526 code = UNSET_HASH; 1543 code = UNSET_HASH;
1527 } else if (reiserfs_tea_hash(s) && code != TEA_HASH) { 1544 } else if (reiserfs_tea_hash(s) && code != TEA_HASH) {
1528 reiserfs_warning(s, "Error, %s hash detected, " 1545 reiserfs_warning(s, "reiserfs-2508",
1546 "Error, %s hash detected, "
1529 "unable to force tea hash", 1547 "unable to force tea hash",
1530 reiserfs_hashname(code)); 1548 reiserfs_hashname(code));
1531 code = UNSET_HASH; 1549 code = UNSET_HASH;
1532 } else if (reiserfs_r5_hash(s) && code != R5_HASH) { 1550 } else if (reiserfs_r5_hash(s) && code != R5_HASH) {
1533 reiserfs_warning(s, "Error, %s hash detected, " 1551 reiserfs_warning(s, "reiserfs-2509",
1552 "Error, %s hash detected, "
1534 "unable to force r5 hash", 1553 "unable to force r5 hash",
1535 reiserfs_hashname(code)); 1554 reiserfs_hashname(code));
1536 code = UNSET_HASH; 1555 code = UNSET_HASH;
@@ -1546,7 +1565,7 @@ static int what_hash(struct super_block *s)
1546 } 1565 }
1547 } 1566 }
1548 1567
1549 /* if we are mounted RW, and we have a new valid hash code, update 1568 /* if we are mounted RW, and we have a new valid hash code, update
1550 ** the super 1569 ** the super
1551 */ 1570 */
1552 if (code != UNSET_HASH && 1571 if (code != UNSET_HASH &&
@@ -1589,9 +1608,9 @@ static int function2code(hashf_t func)
1589 return 0; 1608 return 0;
1590} 1609}
1591 1610
1592#define SWARN(silent, s, ...) \ 1611#define SWARN(silent, s, id, ...) \
1593 if (!(silent)) \ 1612 if (!(silent)) \
1594 reiserfs_warning (s, __VA_ARGS__) 1613 reiserfs_warning(s, id, __VA_ARGS__)
1595 1614
1596static int reiserfs_fill_super(struct super_block *s, void *data, int silent) 1615static int reiserfs_fill_super(struct super_block *s, void *data, int silent)
1597{ 1616{
@@ -1625,10 +1644,6 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent)
1625 REISERFS_SB(s)->s_alloc_options.preallocmin = 0; 1644 REISERFS_SB(s)->s_alloc_options.preallocmin = 0;
1626 /* Preallocate by 16 blocks (17-1) at once */ 1645 /* Preallocate by 16 blocks (17-1) at once */
1627 REISERFS_SB(s)->s_alloc_options.preallocsize = 17; 1646 REISERFS_SB(s)->s_alloc_options.preallocsize = 17;
1628#ifdef CONFIG_REISERFS_FS_XATTR
1629 /* Initialize the rwsem for xattr dir */
1630 init_rwsem(&REISERFS_SB(s)->xattr_dir_sem);
1631#endif
1632 /* setup default block allocator options */ 1647 /* setup default block allocator options */
1633 reiserfs_init_alloc_options(s); 1648 reiserfs_init_alloc_options(s);
1634 1649
@@ -1643,8 +1658,7 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent)
1643#endif 1658#endif
1644 1659
1645 if (blocks) { 1660 if (blocks) {
1646 SWARN(silent, s, "jmacd-7: reiserfs_fill_super: resize option " 1661 SWARN(silent, s, "jmacd-7", "resize option for remount only");
1647 "for remount only");
1648 goto error; 1662 goto error;
1649 } 1663 }
1650 1664
@@ -1653,8 +1667,7 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent)
1653 old_format = 1; 1667 old_format = 1;
1654 /* try new format (64-th 1k block), which can contain reiserfs super block */ 1668 /* 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)) { 1669 else if (read_super_block(s, REISERFS_DISK_OFFSET_IN_BYTES)) {
1656 SWARN(silent, s, 1670 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)); 1671 reiserfs_bdevname(s));
1659 goto error; 1672 goto error;
1660 } 1673 }
@@ -1666,13 +1679,12 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent)
1666 if (s->s_bdev && s->s_bdev->bd_inode 1679 if (s->s_bdev && s->s_bdev->bd_inode
1667 && i_size_read(s->s_bdev->bd_inode) < 1680 && i_size_read(s->s_bdev->bd_inode) <
1668 sb_block_count(rs) * sb_blocksize(rs)) { 1681 sb_block_count(rs) * sb_blocksize(rs)) {
1669 SWARN(silent, s, 1682 SWARN(silent, s, "", "Filesystem cannot be "
1670 "Filesystem on %s cannot be mounted because it is bigger than the device", 1683 "mounted because it is bigger than the device");
1671 reiserfs_bdevname(s)); 1684 SWARN(silent, s, "", "You may need to run fsck "
1672 SWARN(silent, s, 1685 "or increase size of your LVM partition");
1673 "You may need to run fsck or increase size of your LVM partition"); 1686 SWARN(silent, s, "", "Or may be you forgot to "
1674 SWARN(silent, s, 1687 "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; 1688 goto error;
1677 } 1689 }
1678 1690
@@ -1680,14 +1692,13 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent)
1680 sbi->s_mount_state = REISERFS_VALID_FS; 1692 sbi->s_mount_state = REISERFS_VALID_FS;
1681 1693
1682 if ((errval = reiserfs_init_bitmap_cache(s))) { 1694 if ((errval = reiserfs_init_bitmap_cache(s))) {
1683 SWARN(silent, s, 1695 SWARN(silent, s, "jmacd-8", "unable to read bitmap");
1684 "jmacd-8: reiserfs_fill_super: unable to read bitmap");
1685 goto error; 1696 goto error;
1686 } 1697 }
1687 errval = -EINVAL; 1698 errval = -EINVAL;
1688#ifdef CONFIG_REISERFS_CHECK 1699#ifdef CONFIG_REISERFS_CHECK
1689 SWARN(silent, s, "CONFIG_REISERFS_CHECK is set ON"); 1700 SWARN(silent, s, "", "CONFIG_REISERFS_CHECK is set ON");
1690 SWARN(silent, s, "- it is slow mode for debugging."); 1701 SWARN(silent, s, "", "- it is slow mode for debugging.");
1691#endif 1702#endif
1692 1703
1693 /* make data=ordered the default */ 1704 /* make data=ordered the default */
@@ -1708,8 +1719,8 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent)
1708 } 1719 }
1709 // set_device_ro(s->s_dev, 1) ; 1720 // set_device_ro(s->s_dev, 1) ;
1710 if (journal_init(s, jdev_name, old_format, commit_max_age)) { 1721 if (journal_init(s, jdev_name, old_format, commit_max_age)) {
1711 SWARN(silent, s, 1722 SWARN(silent, s, "sh-2022",
1712 "sh-2022: reiserfs_fill_super: unable to initialize journal space"); 1723 "unable to initialize journal space");
1713 goto error; 1724 goto error;
1714 } else { 1725 } else {
1715 jinit_done = 1; /* once this is set, journal_release must be called 1726 jinit_done = 1; /* once this is set, journal_release must be called
@@ -1717,8 +1728,8 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent)
1717 */ 1728 */
1718 } 1729 }
1719 if (reread_meta_blocks(s)) { 1730 if (reread_meta_blocks(s)) {
1720 SWARN(silent, s, 1731 SWARN(silent, s, "jmacd-9",
1721 "jmacd-9: reiserfs_fill_super: unable to reread meta blocks after journal init"); 1732 "unable to reread meta blocks after journal init");
1722 goto error; 1733 goto error;
1723 } 1734 }
1724 1735
@@ -1726,8 +1737,8 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent)
1726 goto error; 1737 goto error;
1727 1738
1728 if (bdev_read_only(s->s_bdev) && !(s->s_flags & MS_RDONLY)) { 1739 if (bdev_read_only(s->s_bdev) && !(s->s_flags & MS_RDONLY)) {
1729 SWARN(silent, s, 1740 SWARN(silent, s, "clm-7000",
1730 "clm-7000: Detected readonly device, marking FS readonly"); 1741 "Detected readonly device, marking FS readonly");
1731 s->s_flags |= MS_RDONLY; 1742 s->s_flags |= MS_RDONLY;
1732 } 1743 }
1733 args.objectid = REISERFS_ROOT_OBJECTID; 1744 args.objectid = REISERFS_ROOT_OBJECTID;
@@ -1736,8 +1747,7 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent)
1736 iget5_locked(s, REISERFS_ROOT_OBJECTID, reiserfs_find_actor, 1747 iget5_locked(s, REISERFS_ROOT_OBJECTID, reiserfs_find_actor,
1737 reiserfs_init_locked_inode, (void *)(&args)); 1748 reiserfs_init_locked_inode, (void *)(&args));
1738 if (!root_inode) { 1749 if (!root_inode) {
1739 SWARN(silent, s, 1750 SWARN(silent, s, "jmacd-10", "get root inode failed");
1740 "jmacd-10: reiserfs_fill_super: get root inode failed");
1741 goto error; 1751 goto error;
1742 } 1752 }
1743 1753
@@ -1786,7 +1796,7 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent)
1786 * avoiding corruption. -jeffm */ 1796 * avoiding corruption. -jeffm */
1787 if (bmap_would_wrap(reiserfs_bmap_count(s)) && 1797 if (bmap_would_wrap(reiserfs_bmap_count(s)) &&
1788 sb_bmap_nr(rs) != 0) { 1798 sb_bmap_nr(rs) != 0) {
1789 reiserfs_warning(s, "super-2030: This file system " 1799 reiserfs_warning(s, "super-2030", "This file system "
1790 "claims to use %u bitmap blocks in " 1800 "claims to use %u bitmap blocks in "
1791 "its super block, but requires %u. " 1801 "its super block, but requires %u. "
1792 "Clearing to zero.", sb_bmap_nr(rs), 1802 "Clearing to zero.", sb_bmap_nr(rs),
@@ -1819,7 +1829,9 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent)
1819 } else if (!silent) { 1829 } else if (!silent) {
1820 reiserfs_info(s, "using 3.5.x disk format\n"); 1830 reiserfs_info(s, "using 3.5.x disk format\n");
1821 } 1831 }
1822 } 1832 } else
1833 set_sb_mnt_count(rs, sb_mnt_count(rs) + 1);
1834
1823 1835
1824 journal_mark_dirty(&th, s, SB_BUFFER_WITH_SB(s)); 1836 journal_mark_dirty(&th, s, SB_BUFFER_WITH_SB(s));
1825 errval = journal_end(&th, s, 1); 1837 errval = journal_end(&th, s, 1);
@@ -1896,58 +1908,6 @@ static int reiserfs_statfs(struct dentry *dentry, struct kstatfs *buf)
1896} 1908}
1897 1909
1898#ifdef CONFIG_QUOTA 1910#ifdef CONFIG_QUOTA
1899static int reiserfs_dquot_initialize(struct inode *inode, int type)
1900{
1901 struct reiserfs_transaction_handle th;
1902 int ret, err;
1903
1904 /* We may create quota structure so we need to reserve enough blocks */
1905 reiserfs_write_lock(inode->i_sb);
1906 ret =
1907 journal_begin(&th, inode->i_sb,
1908 2 * REISERFS_QUOTA_INIT_BLOCKS(inode->i_sb));
1909 if (ret)
1910 goto out;
1911 ret = dquot_initialize(inode, type);
1912 err =
1913 journal_end(&th, inode->i_sb,
1914 2 * REISERFS_QUOTA_INIT_BLOCKS(inode->i_sb));
1915 if (!ret && err)
1916 ret = err;
1917 out:
1918 reiserfs_write_unlock(inode->i_sb);
1919 return ret;
1920}
1921
1922static int reiserfs_dquot_drop(struct inode *inode)
1923{
1924 struct reiserfs_transaction_handle th;
1925 int ret, err;
1926
1927 /* We may delete quota structure so we need to reserve enough blocks */
1928 reiserfs_write_lock(inode->i_sb);
1929 ret =
1930 journal_begin(&th, inode->i_sb,
1931 2 * REISERFS_QUOTA_DEL_BLOCKS(inode->i_sb));
1932 if (ret) {
1933 /*
1934 * We call dquot_drop() anyway to at least release references
1935 * to quota structures so that umount does not hang.
1936 */
1937 dquot_drop(inode);
1938 goto out;
1939 }
1940 ret = dquot_drop(inode);
1941 err =
1942 journal_end(&th, inode->i_sb,
1943 2 * REISERFS_QUOTA_DEL_BLOCKS(inode->i_sb));
1944 if (!ret && err)
1945 ret = err;
1946 out:
1947 reiserfs_write_unlock(inode->i_sb);
1948 return ret;
1949}
1950
1951static int reiserfs_write_dquot(struct dquot *dquot) 1911static int reiserfs_write_dquot(struct dquot *dquot)
1952{ 1912{
1953 struct reiserfs_transaction_handle th; 1913 struct reiserfs_transaction_handle th;
@@ -2085,8 +2045,8 @@ static int reiserfs_quota_on(struct super_block *sb, int type, int format_id,
2085 if (!(REISERFS_I(inode)->i_flags & i_nopack_mask)) { 2045 if (!(REISERFS_I(inode)->i_flags & i_nopack_mask)) {
2086 err = reiserfs_unpack(inode, NULL); 2046 err = reiserfs_unpack(inode, NULL);
2087 if (err) { 2047 if (err) {
2088 reiserfs_warning(sb, 2048 reiserfs_warning(sb, "super-6520",
2089 "reiserfs: Unpacking tail of quota file failed" 2049 "Unpacking tail of quota file failed"
2090 " (%d). Cannot turn on quotas.", err); 2050 " (%d). Cannot turn on quotas.", err);
2091 err = -EINVAL; 2051 err = -EINVAL;
2092 goto out; 2052 goto out;
@@ -2097,8 +2057,8 @@ static int reiserfs_quota_on(struct super_block *sb, int type, int format_id,
2097 if (REISERFS_SB(sb)->s_qf_names[type]) { 2057 if (REISERFS_SB(sb)->s_qf_names[type]) {
2098 /* Quotafile not of fs root? */ 2058 /* Quotafile not of fs root? */
2099 if (path.dentry->d_parent != sb->s_root) 2059 if (path.dentry->d_parent != sb->s_root)
2100 reiserfs_warning(sb, 2060 reiserfs_warning(sb, "super-6521",
2101 "reiserfs: Quota file not on filesystem root. " 2061 "Quota file not on filesystem root. "
2102 "Journalled quota will not work."); 2062 "Journalled quota will not work.");
2103 } 2063 }
2104 2064
@@ -2249,9 +2209,6 @@ static int __init init_reiserfs_fs(void)
2249 return ret; 2209 return ret;
2250 } 2210 }
2251 2211
2252 if ((ret = reiserfs_xattr_register_handlers()))
2253 goto failed_reiserfs_xattr_register_handlers;
2254
2255 reiserfs_proc_info_global_init(); 2212 reiserfs_proc_info_global_init();
2256 reiserfs_proc_register_global("version", 2213 reiserfs_proc_register_global("version",
2257 reiserfs_global_version_in_proc); 2214 reiserfs_global_version_in_proc);
@@ -2262,9 +2219,6 @@ static int __init init_reiserfs_fs(void)
2262 return 0; 2219 return 0;
2263 } 2220 }
2264 2221
2265 reiserfs_xattr_unregister_handlers();
2266
2267 failed_reiserfs_xattr_register_handlers:
2268 reiserfs_proc_unregister_global("version"); 2222 reiserfs_proc_unregister_global("version");
2269 reiserfs_proc_info_global_done(); 2223 reiserfs_proc_info_global_done();
2270 destroy_inodecache(); 2224 destroy_inodecache();
@@ -2274,7 +2228,6 @@ static int __init init_reiserfs_fs(void)
2274 2228
2275static void __exit exit_reiserfs_fs(void) 2229static void __exit exit_reiserfs_fs(void)
2276{ 2230{
2277 reiserfs_xattr_unregister_handlers();
2278 reiserfs_proc_unregister_global("version"); 2231 reiserfs_proc_unregister_global("version");
2279 reiserfs_proc_info_global_done(); 2232 reiserfs_proc_info_global_done();
2280 unregister_filesystem(&reiserfs_fs_type); 2233 unregister_filesystem(&reiserfs_fs_type);