aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJeff Mahoney <jeffm@suse.com>2009-03-30 14:02:21 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-03-30 15:16:36 -0400
commit45b03d5e8e674eb6555b767e1c8eb40b671ff892 (patch)
treed74acd1be7f5102143df960e8cd692aadcc437df /fs
parent1d889d9958490888b3fad1d486145d9a03559cbc (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')
-rw-r--r--fs/reiserfs/bitmap.c52
-rw-r--r--fs/reiserfs/do_balan.c40
-rw-r--r--fs/reiserfs/file.c2
-rw-r--r--fs/reiserfs/fix_node.c14
-rw-r--r--fs/reiserfs/inode.c60
-rw-r--r--fs/reiserfs/item_ops.c60
-rw-r--r--fs/reiserfs/journal.c174
-rw-r--r--fs/reiserfs/lbalance.c12
-rw-r--r--fs/reiserfs/namei.c45
-rw-r--r--fs/reiserfs/objectid.c5
-rw-r--r--fs/reiserfs/prints.c11
-rw-r--r--fs/reiserfs/procfs.c5
-rw-r--r--fs/reiserfs/stree.c107
-rw-r--r--fs/reiserfs/super.c257
-rw-r--r--fs/reiserfs/tail_conversion.c6
-rw-r--r--fs/reiserfs/xattr.c21
16 files changed, 448 insertions, 423 deletions
diff --git a/fs/reiserfs/bitmap.c b/fs/reiserfs/bitmap.c
index 98b92a3da14a..51b116103041 100644
--- a/fs/reiserfs/bitmap.c
+++ b/fs/reiserfs/bitmap.c
@@ -64,8 +64,8 @@ int is_reusable(struct super_block *s, b_blocknr_t block, int bit_value)
64 unsigned int bmap_count = reiserfs_bmap_count(s); 64 unsigned int bmap_count = reiserfs_bmap_count(s);
65 65
66 if (block == 0 || block >= SB_BLOCK_COUNT(s)) { 66 if (block == 0 || block >= SB_BLOCK_COUNT(s)) {
67 reiserfs_warning(s, 67 reiserfs_warning(s, "vs-4010",
68 "vs-4010: is_reusable: block number is out of range %lu (%u)", 68 "block number is out of range %lu (%u)",
69 block, SB_BLOCK_COUNT(s)); 69 block, SB_BLOCK_COUNT(s));
70 return 0; 70 return 0;
71 } 71 }
@@ -79,30 +79,29 @@ int is_reusable(struct super_block *s, b_blocknr_t block, int bit_value)
79 b_blocknr_t bmap1 = REISERFS_SB(s)->s_sbh->b_blocknr + 1; 79 b_blocknr_t bmap1 = REISERFS_SB(s)->s_sbh->b_blocknr + 1;
80 if (block >= bmap1 && 80 if (block >= bmap1 &&
81 block <= bmap1 + bmap_count) { 81 block <= bmap1 + bmap_count) {
82 reiserfs_warning(s, "vs: 4019: is_reusable: " 82 reiserfs_warning(s, "vs-4019", "bitmap block %lu(%u) "
83 "bitmap block %lu(%u) can't be freed or reused", 83 "can't be freed or reused",
84 block, bmap_count); 84 block, bmap_count);
85 return 0; 85 return 0;
86 } 86 }
87 } else { 87 } else {
88 if (offset == 0) { 88 if (offset == 0) {
89 reiserfs_warning(s, "vs: 4020: is_reusable: " 89 reiserfs_warning(s, "vs-4020", "bitmap block %lu(%u) "
90 "bitmap block %lu(%u) can't be freed or reused", 90 "can't be freed or reused",
91 block, bmap_count); 91 block, bmap_count);
92 return 0; 92 return 0;
93 } 93 }
94 } 94 }
95 95
96 if (bmap >= bmap_count) { 96 if (bmap >= bmap_count) {
97 reiserfs_warning(s, 97 reiserfs_warning(s, "vs-4030", "bitmap for requested block "
98 "vs-4030: is_reusable: there is no so many bitmap blocks: " 98 "is out of range: block=%lu, bitmap_nr=%u",
99 "block=%lu, bitmap_nr=%u", block, bmap); 99 block, bmap);
100 return 0; 100 return 0;
101 } 101 }
102 102
103 if (bit_value == 0 && block == SB_ROOT_BLOCK(s)) { 103 if (bit_value == 0 && block == SB_ROOT_BLOCK(s)) {
104 reiserfs_warning(s, 104 reiserfs_warning(s, "vs-4050", "this is root block (%u), "
105 "vs-4050: is_reusable: this is root block (%u), "
106 "it must be busy", SB_ROOT_BLOCK(s)); 105 "it must be busy", SB_ROOT_BLOCK(s));
107 return 0; 106 return 0;
108 } 107 }
@@ -154,8 +153,8 @@ static int scan_bitmap_block(struct reiserfs_transaction_handle *th,
154/* - I mean `a window of zero bits' as in description of this function - Zam. */ 153/* - I mean `a window of zero bits' as in description of this function - Zam. */
155 154
156 if (!bi) { 155 if (!bi) {
157 reiserfs_warning(s, "NULL bitmap info pointer for bitmap %d", 156 reiserfs_warning(s, "jdm-4055", "NULL bitmap info pointer "
158 bmap_n); 157 "for bitmap %d", bmap_n);
159 return 0; 158 return 0;
160 } 159 }
161 160
@@ -400,11 +399,8 @@ static void _reiserfs_free_block(struct reiserfs_transaction_handle *th,
400 get_bit_address(s, block, &nr, &offset); 399 get_bit_address(s, block, &nr, &offset);
401 400
402 if (nr >= reiserfs_bmap_count(s)) { 401 if (nr >= reiserfs_bmap_count(s)) {
403 reiserfs_warning(s, "vs-4075: reiserfs_free_block: " 402 reiserfs_warning(s, "vs-4075", "block %lu is out of range",
404 "block %lu is out of range on %s " 403 block);
405 "(nr=%u,max=%u)", block,
406 reiserfs_bdevname(s), nr,
407 reiserfs_bmap_count(s));
408 return; 404 return;
409 } 405 }
410 406
@@ -416,9 +412,8 @@ static void _reiserfs_free_block(struct reiserfs_transaction_handle *th,
416 412
417 /* clear bit for the given block in bit map */ 413 /* clear bit for the given block in bit map */
418 if (!reiserfs_test_and_clear_le_bit(offset, bmbh->b_data)) { 414 if (!reiserfs_test_and_clear_le_bit(offset, bmbh->b_data)) {
419 reiserfs_warning(s, "vs-4080: reiserfs_free_block: " 415 reiserfs_warning(s, "vs-4080",
420 "free_block (%s:%lu)[dev:blocknr]: bit already cleared", 416 "block %lu: bit already cleared", block);
421 reiserfs_bdevname(s), block);
422 } 417 }
423 apbi[nr].free_count++; 418 apbi[nr].free_count++;
424 journal_mark_dirty(th, s, bmbh); 419 journal_mark_dirty(th, s, bmbh);
@@ -477,9 +472,8 @@ static void __discard_prealloc(struct reiserfs_transaction_handle *th,
477 BUG_ON(!th->t_trans_id); 472 BUG_ON(!th->t_trans_id);
478#ifdef CONFIG_REISERFS_CHECK 473#ifdef CONFIG_REISERFS_CHECK
479 if (ei->i_prealloc_count < 0) 474 if (ei->i_prealloc_count < 0)
480 reiserfs_warning(th->t_super, 475 reiserfs_warning(th->t_super, "zam-4001",
481 "zam-4001:%s: inode has negative prealloc blocks count.", 476 "inode has negative prealloc blocks count.");
482 __func__);
483#endif 477#endif
484 while (ei->i_prealloc_count > 0) { 478 while (ei->i_prealloc_count > 0) {
485 reiserfs_free_prealloc_block(th, inode, ei->i_prealloc_block); 479 reiserfs_free_prealloc_block(th, inode, ei->i_prealloc_block);
@@ -515,9 +509,9 @@ void reiserfs_discard_all_prealloc(struct reiserfs_transaction_handle *th)
515 i_prealloc_list); 509 i_prealloc_list);
516#ifdef CONFIG_REISERFS_CHECK 510#ifdef CONFIG_REISERFS_CHECK
517 if (!ei->i_prealloc_count) { 511 if (!ei->i_prealloc_count) {
518 reiserfs_warning(th->t_super, 512 reiserfs_warning(th->t_super, "zam-4001",
519 "zam-4001:%s: inode is in prealloc list but has no preallocated blocks.", 513 "inode is in prealloc list but has "
520 __func__); 514 "no preallocated blocks.");
521 } 515 }
522#endif 516#endif
523 __discard_prealloc(th, ei); 517 __discard_prealloc(th, ei);
@@ -631,8 +625,8 @@ int reiserfs_parse_alloc_options(struct super_block *s, char *options)
631 continue; 625 continue;
632 } 626 }
633 627
634 reiserfs_warning(s, "zam-4001: %s : unknown option - %s", 628 reiserfs_warning(s, "zam-4001", "unknown option - %s",
635 __func__, this_char); 629 this_char);
636 return 1; 630 return 1;
637 } 631 }
638 632
diff --git a/fs/reiserfs/do_balan.c b/fs/reiserfs/do_balan.c
index 99f80538c4bf..f701f37ddf98 100644
--- a/fs/reiserfs/do_balan.c
+++ b/fs/reiserfs/do_balan.c
@@ -1752,15 +1752,16 @@ static void store_thrown(struct tree_balance *tb, struct buffer_head *bh)
1752 int i; 1752 int i;
1753 1753
1754 if (buffer_dirty(bh)) 1754 if (buffer_dirty(bh))
1755 reiserfs_warning(tb->tb_sb, 1755 reiserfs_warning(tb->tb_sb, "reiserfs-12320",
1756 "store_thrown deals with dirty buffer"); 1756 "called with dirty buffer");
1757 for (i = 0; i < ARRAY_SIZE(tb->thrown); i++) 1757 for (i = 0; i < ARRAY_SIZE(tb->thrown); i++)
1758 if (!tb->thrown[i]) { 1758 if (!tb->thrown[i]) {
1759 tb->thrown[i] = bh; 1759 tb->thrown[i] = bh;
1760 get_bh(bh); /* free_thrown puts this */ 1760 get_bh(bh); /* free_thrown puts this */
1761 return; 1761 return;
1762 } 1762 }
1763 reiserfs_warning(tb->tb_sb, "store_thrown: too many thrown buffers"); 1763 reiserfs_warning(tb->tb_sb, "reiserfs-12321",
1764 "too many thrown buffers");
1764} 1765}
1765 1766
1766static void free_thrown(struct tree_balance *tb) 1767static void free_thrown(struct tree_balance *tb)
@@ -1771,8 +1772,8 @@ static void free_thrown(struct tree_balance *tb)
1771 if (tb->thrown[i]) { 1772 if (tb->thrown[i]) {
1772 blocknr = tb->thrown[i]->b_blocknr; 1773 blocknr = tb->thrown[i]->b_blocknr;
1773 if (buffer_dirty(tb->thrown[i])) 1774 if (buffer_dirty(tb->thrown[i]))
1774 reiserfs_warning(tb->tb_sb, 1775 reiserfs_warning(tb->tb_sb, "reiserfs-12322",
1775 "free_thrown deals with dirty buffer %d", 1776 "called with dirty buffer %d",
1776 blocknr); 1777 blocknr);
1777 brelse(tb->thrown[i]); /* incremented in store_thrown */ 1778 brelse(tb->thrown[i]); /* incremented in store_thrown */
1778 reiserfs_free_block(tb->transaction_handle, NULL, 1779 reiserfs_free_block(tb->transaction_handle, NULL,
@@ -1877,13 +1878,12 @@ static void check_internal_node(struct super_block *s, struct buffer_head *bh,
1877 } 1878 }
1878} 1879}
1879 1880
1880static int locked_or_not_in_tree(struct buffer_head *bh, char *which) 1881static int locked_or_not_in_tree(struct tree_balance *tb,
1882 struct buffer_head *bh, char *which)
1881{ 1883{
1882 if ((!buffer_journal_prepared(bh) && buffer_locked(bh)) || 1884 if ((!buffer_journal_prepared(bh) && buffer_locked(bh)) ||
1883 !B_IS_IN_TREE(bh)) { 1885 !B_IS_IN_TREE(bh)) {
1884 reiserfs_warning(NULL, 1886 reiserfs_warning(tb->tb_sb, "vs-12339", "%s (%b)", which, bh);
1885 "vs-12339: locked_or_not_in_tree: %s (%b)",
1886 which, bh);
1887 return 1; 1887 return 1;
1888 } 1888 }
1889 return 0; 1889 return 0;
@@ -1902,18 +1902,19 @@ static int check_before_balancing(struct tree_balance *tb)
1902 /* double check that buffers that we will modify are unlocked. (fix_nodes should already have 1902 /* double check that buffers that we will modify are unlocked. (fix_nodes should already have
1903 prepped all of these for us). */ 1903 prepped all of these for us). */
1904 if (tb->lnum[0]) { 1904 if (tb->lnum[0]) {
1905 retval |= locked_or_not_in_tree(tb->L[0], "L[0]"); 1905 retval |= locked_or_not_in_tree(tb, tb->L[0], "L[0]");
1906 retval |= locked_or_not_in_tree(tb->FL[0], "FL[0]"); 1906 retval |= locked_or_not_in_tree(tb, tb->FL[0], "FL[0]");
1907 retval |= locked_or_not_in_tree(tb->CFL[0], "CFL[0]"); 1907 retval |= locked_or_not_in_tree(tb, tb->CFL[0], "CFL[0]");
1908 check_leaf(tb->L[0]); 1908 check_leaf(tb->L[0]);
1909 } 1909 }
1910 if (tb->rnum[0]) { 1910 if (tb->rnum[0]) {
1911 retval |= locked_or_not_in_tree(tb->R[0], "R[0]"); 1911 retval |= locked_or_not_in_tree(tb, tb->R[0], "R[0]");
1912 retval |= locked_or_not_in_tree(tb->FR[0], "FR[0]"); 1912 retval |= locked_or_not_in_tree(tb, tb->FR[0], "FR[0]");
1913 retval |= locked_or_not_in_tree(tb->CFR[0], "CFR[0]"); 1913 retval |= locked_or_not_in_tree(tb, tb->CFR[0], "CFR[0]");
1914 check_leaf(tb->R[0]); 1914 check_leaf(tb->R[0]);
1915 } 1915 }
1916 retval |= locked_or_not_in_tree(PATH_PLAST_BUFFER(tb->tb_path), "S[0]"); 1916 retval |= locked_or_not_in_tree(tb, PATH_PLAST_BUFFER(tb->tb_path),
1917 "S[0]");
1917 check_leaf(PATH_PLAST_BUFFER(tb->tb_path)); 1918 check_leaf(PATH_PLAST_BUFFER(tb->tb_path));
1918 1919
1919 return retval; 1920 return retval;
@@ -1952,7 +1953,7 @@ static void check_after_balance_leaf(struct tree_balance *tb)
1952 PATH_H_POSITION(tb->tb_path, 1953 PATH_H_POSITION(tb->tb_path,
1953 1)))); 1954 1))));
1954 print_cur_tb("12223"); 1955 print_cur_tb("12223");
1955 reiserfs_warning(tb->tb_sb, 1956 reiserfs_warning(tb->tb_sb, "reiserfs-12363",
1956 "B_FREE_SPACE (PATH_H_PBUFFER(tb->tb_path,0)) = %d; " 1957 "B_FREE_SPACE (PATH_H_PBUFFER(tb->tb_path,0)) = %d; "
1957 "MAX_CHILD_SIZE (%d) - dc_size( %y, %d ) [%d] = %d", 1958 "MAX_CHILD_SIZE (%d) - dc_size( %y, %d ) [%d] = %d",
1958 left, 1959 left,
@@ -2104,9 +2105,8 @@ void do_balance(struct tree_balance *tb, /* tree_balance structure */
2104 } 2105 }
2105 /* if we have no real work to do */ 2106 /* if we have no real work to do */
2106 if (!tb->insert_size[0]) { 2107 if (!tb->insert_size[0]) {
2107 reiserfs_warning(tb->tb_sb, 2108 reiserfs_warning(tb->tb_sb, "PAP-12350",
2108 "PAP-12350: do_balance: insert_size == 0, mode == %c", 2109 "insert_size == 0, mode == %c", flag);
2109 flag);
2110 unfix_nodes(tb); 2110 unfix_nodes(tb);
2111 return; 2111 return;
2112 } 2112 }
diff --git a/fs/reiserfs/file.c b/fs/reiserfs/file.c
index 33408417038c..47bab8978be1 100644
--- a/fs/reiserfs/file.c
+++ b/fs/reiserfs/file.c
@@ -76,7 +76,7 @@ static int reiserfs_file_release(struct inode *inode, struct file *filp)
76 * and let the admin know what is going on. 76 * and let the admin know what is going on.
77 */ 77 */
78 igrab(inode); 78 igrab(inode);
79 reiserfs_warning(inode->i_sb, 79 reiserfs_warning(inode->i_sb, "clm-9001",
80 "pinning inode %lu because the " 80 "pinning inode %lu because the "
81 "preallocation can't be freed", 81 "preallocation can't be freed",
82 inode->i_ino); 82 inode->i_ino);
diff --git a/fs/reiserfs/fix_node.c b/fs/reiserfs/fix_node.c
index 07d05e0842b7..59735a9e2349 100644
--- a/fs/reiserfs/fix_node.c
+++ b/fs/reiserfs/fix_node.c
@@ -496,8 +496,8 @@ static int get_num_ver(int mode, struct tree_balance *tb, int h,
496 snum012[needed_nodes - 1 + 3] = units; 496 snum012[needed_nodes - 1 + 3] = units;
497 497
498 if (needed_nodes > 2) 498 if (needed_nodes > 2)
499 reiserfs_warning(tb->tb_sb, "vs-8111: get_num_ver: " 499 reiserfs_warning(tb->tb_sb, "vs-8111",
500 "split_item_position is out of boundary"); 500 "split_item_position is out of range");
501 snum012[needed_nodes - 1]++; 501 snum012[needed_nodes - 1]++;
502 split_item_positions[needed_nodes - 1] = i; 502 split_item_positions[needed_nodes - 1] = i;
503 needed_nodes++; 503 needed_nodes++;
@@ -533,8 +533,8 @@ static int get_num_ver(int mode, struct tree_balance *tb, int h,
533 533
534 if (vn->vn_vi[split_item_num].vi_index != TYPE_DIRENTRY && 534 if (vn->vn_vi[split_item_num].vi_index != TYPE_DIRENTRY &&
535 vn->vn_vi[split_item_num].vi_index != TYPE_INDIRECT) 535 vn->vn_vi[split_item_num].vi_index != TYPE_INDIRECT)
536 reiserfs_warning(tb->tb_sb, "vs-8115: get_num_ver: not " 536 reiserfs_warning(tb->tb_sb, "vs-8115",
537 "directory or indirect item"); 537 "not directory or indirect item");
538 } 538 }
539 539
540 /* now we know S2bytes, calculate S1bytes */ 540 /* now we know S2bytes, calculate S1bytes */
@@ -2268,9 +2268,9 @@ static int wait_tb_buffers_until_unlocked(struct tree_balance *p_s_tb)
2268#ifdef CONFIG_REISERFS_CHECK 2268#ifdef CONFIG_REISERFS_CHECK
2269 repeat_counter++; 2269 repeat_counter++;
2270 if ((repeat_counter % 10000) == 0) { 2270 if ((repeat_counter % 10000) == 0) {
2271 reiserfs_warning(p_s_tb->tb_sb, 2271 reiserfs_warning(p_s_tb->tb_sb, "reiserfs-8200",
2272 "wait_tb_buffers_until_released(): too many " 2272 "too many iterations waiting "
2273 "iterations waiting for buffer to unlock " 2273 "for buffer to unlock "
2274 "(%b)", locked); 2274 "(%b)", locked);
2275 2275
2276 /* Don't loop forever. Try to recover from possible error. */ 2276 /* Don't loop forever. Try to recover from possible error. */
diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c
index 55fce92cdf18..95157762b1bf 100644
--- a/fs/reiserfs/inode.c
+++ b/fs/reiserfs/inode.c
@@ -842,7 +842,9 @@ int reiserfs_get_block(struct inode *inode, sector_t block,
842 if (retval) { 842 if (retval) {
843 if (retval != -ENOSPC) 843 if (retval != -ENOSPC)
844 reiserfs_warning(inode->i_sb, 844 reiserfs_warning(inode->i_sb,
845 "clm-6004: convert tail failed inode %lu, error %d", 845 "clm-6004",
846 "convert tail failed "
847 "inode %lu, error %d",
846 inode->i_ino, 848 inode->i_ino,
847 retval); 849 retval);
848 if (allocated_block_nr) { 850 if (allocated_block_nr) {
@@ -1006,8 +1008,7 @@ int reiserfs_get_block(struct inode *inode, sector_t block,
1006 goto failure; 1008 goto failure;
1007 } 1009 }
1008 if (retval == POSITION_FOUND) { 1010 if (retval == POSITION_FOUND) {
1009 reiserfs_warning(inode->i_sb, 1011 reiserfs_warning(inode->i_sb, "vs-825",
1010 "vs-825: reiserfs_get_block: "
1011 "%K should not be found", &key); 1012 "%K should not be found", &key);
1012 retval = -EEXIST; 1013 retval = -EEXIST;
1013 if (allocated_block_nr) 1014 if (allocated_block_nr)
@@ -1332,9 +1333,9 @@ void reiserfs_update_sd_size(struct reiserfs_transaction_handle *th,
1332 /* look for the object's stat data */ 1333 /* look for the object's stat data */
1333 retval = search_item(inode->i_sb, &key, &path); 1334 retval = search_item(inode->i_sb, &key, &path);
1334 if (retval == IO_ERROR) { 1335 if (retval == IO_ERROR) {
1335 reiserfs_warning(inode->i_sb, 1336 reiserfs_warning(inode->i_sb, "vs-13050",
1336 "vs-13050: reiserfs_update_sd: " 1337 "i/o failure occurred trying to "
1337 "i/o failure occurred trying to update %K stat data", 1338 "update %K stat data",
1338 &key); 1339 &key);
1339 return; 1340 return;
1340 } 1341 }
@@ -1345,9 +1346,9 @@ void reiserfs_update_sd_size(struct reiserfs_transaction_handle *th,
1345 /*reiserfs_warning (inode->i_sb, "vs-13050: reiserfs_update_sd: i_nlink == 0, stat data not found"); */ 1346 /*reiserfs_warning (inode->i_sb, "vs-13050: reiserfs_update_sd: i_nlink == 0, stat data not found"); */
1346 return; 1347 return;
1347 } 1348 }
1348 reiserfs_warning(inode->i_sb, 1349 reiserfs_warning(inode->i_sb, "vs-13060",
1349 "vs-13060: reiserfs_update_sd: " 1350 "stat data of object %k (nlink == %d) "
1350 "stat data of object %k (nlink == %d) not found (pos %d)", 1351 "not found (pos %d)",
1351 INODE_PKEY(inode), inode->i_nlink, 1352 INODE_PKEY(inode), inode->i_nlink,
1352 pos); 1353 pos);
1353 reiserfs_check_path(&path); 1354 reiserfs_check_path(&path);
@@ -1424,10 +1425,9 @@ void reiserfs_read_locked_inode(struct inode *inode,
1424 /* look for the object's stat data */ 1425 /* look for the object's stat data */
1425 retval = search_item(inode->i_sb, &key, &path_to_sd); 1426 retval = search_item(inode->i_sb, &key, &path_to_sd);
1426 if (retval == IO_ERROR) { 1427 if (retval == IO_ERROR) {
1427 reiserfs_warning(inode->i_sb, 1428 reiserfs_warning(inode->i_sb, "vs-13070",
1428 "vs-13070: reiserfs_read_locked_inode: " 1429 "i/o failure occurred trying to find "
1429 "i/o failure occurred trying to find stat data of %K", 1430 "stat data of %K", &key);
1430 &key);
1431 reiserfs_make_bad_inode(inode); 1431 reiserfs_make_bad_inode(inode);
1432 return; 1432 return;
1433 } 1433 }
@@ -1457,8 +1457,7 @@ void reiserfs_read_locked_inode(struct inode *inode,
1457 during mount (fs/reiserfs/super.c:finish_unfinished()). */ 1457 during mount (fs/reiserfs/super.c:finish_unfinished()). */
1458 if ((inode->i_nlink == 0) && 1458 if ((inode->i_nlink == 0) &&
1459 !REISERFS_SB(inode->i_sb)->s_is_unlinked_ok) { 1459 !REISERFS_SB(inode->i_sb)->s_is_unlinked_ok) {
1460 reiserfs_warning(inode->i_sb, 1460 reiserfs_warning(inode->i_sb, "vs-13075",
1461 "vs-13075: reiserfs_read_locked_inode: "
1462 "dead inode read from disk %K. " 1461 "dead inode read from disk %K. "
1463 "This is likely to be race with knfsd. Ignore", 1462 "This is likely to be race with knfsd. Ignore",
1464 &key); 1463 &key);
@@ -1555,7 +1554,7 @@ struct dentry *reiserfs_fh_to_dentry(struct super_block *sb, struct fid *fid,
1555 */ 1554 */
1556 if (fh_type > fh_len) { 1555 if (fh_type > fh_len) {
1557 if (fh_type != 6 || fh_len != 5) 1556 if (fh_type != 6 || fh_len != 5)
1558 reiserfs_warning(sb, 1557 reiserfs_warning(sb, "reiserfs-13077",
1559 "nfsd/reiserfs, fhtype=%d, len=%d - odd", 1558 "nfsd/reiserfs, fhtype=%d, len=%d - odd",
1560 fh_type, fh_len); 1559 fh_type, fh_len);
1561 fh_type = 5; 1560 fh_type = 5;
@@ -1680,13 +1679,13 @@ static int reiserfs_new_directory(struct reiserfs_transaction_handle *th,
1680 /* look for place in the tree for new item */ 1679 /* look for place in the tree for new item */
1681 retval = search_item(sb, &key, path); 1680 retval = search_item(sb, &key, path);
1682 if (retval == IO_ERROR) { 1681 if (retval == IO_ERROR) {
1683 reiserfs_warning(sb, "vs-13080: reiserfs_new_directory: " 1682 reiserfs_warning(sb, "vs-13080",
1684 "i/o failure occurred creating new directory"); 1683 "i/o failure occurred creating new directory");
1685 return -EIO; 1684 return -EIO;
1686 } 1685 }
1687 if (retval == ITEM_FOUND) { 1686 if (retval == ITEM_FOUND) {
1688 pathrelse(path); 1687 pathrelse(path);
1689 reiserfs_warning(sb, "vs-13070: reiserfs_new_directory: " 1688 reiserfs_warning(sb, "vs-13070",
1690 "object with this key exists (%k)", 1689 "object with this key exists (%k)",
1691 &(ih->ih_key)); 1690 &(ih->ih_key));
1692 return -EEXIST; 1691 return -EEXIST;
@@ -1720,13 +1719,13 @@ static int reiserfs_new_symlink(struct reiserfs_transaction_handle *th, struct i
1720 /* look for place in the tree for new item */ 1719 /* look for place in the tree for new item */
1721 retval = search_item(sb, &key, path); 1720 retval = search_item(sb, &key, path);
1722 if (retval == IO_ERROR) { 1721 if (retval == IO_ERROR) {
1723 reiserfs_warning(sb, "vs-13080: reiserfs_new_symlinik: " 1722 reiserfs_warning(sb, "vs-13080",
1724 "i/o failure occurred creating new symlink"); 1723 "i/o failure occurred creating new symlink");
1725 return -EIO; 1724 return -EIO;
1726 } 1725 }
1727 if (retval == ITEM_FOUND) { 1726 if (retval == ITEM_FOUND) {
1728 pathrelse(path); 1727 pathrelse(path);
1729 reiserfs_warning(sb, "vs-13080: reiserfs_new_symlink: " 1728 reiserfs_warning(sb, "vs-13080",
1730 "object with this key exists (%k)", 1729 "object with this key exists (%k)",
1731 &(ih->ih_key)); 1730 &(ih->ih_key));
1732 return -EEXIST; 1731 return -EEXIST;
@@ -1927,7 +1926,8 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th,
1927 goto out_inserted_sd; 1926 goto out_inserted_sd;
1928 } 1927 }
1929 } else if (inode->i_sb->s_flags & MS_POSIXACL) { 1928 } else if (inode->i_sb->s_flags & MS_POSIXACL) {
1930 reiserfs_warning(inode->i_sb, "ACLs aren't enabled in the fs, " 1929 reiserfs_warning(inode->i_sb, "jdm-13090",
1930 "ACLs aren't enabled in the fs, "
1931 "but vfs thinks they are!"); 1931 "but vfs thinks they are!");
1932 } else if (is_reiserfs_priv_object(dir)) { 1932 } else if (is_reiserfs_priv_object(dir)) {
1933 reiserfs_mark_inode_private(inode); 1933 reiserfs_mark_inode_private(inode);
@@ -2044,8 +2044,8 @@ static int grab_tail_page(struct inode *p_s_inode,
2044 ** I've screwed up the code to find the buffer, or the code to 2044 ** I've screwed up the code to find the buffer, or the code to
2045 ** call prepare_write 2045 ** call prepare_write
2046 */ 2046 */
2047 reiserfs_warning(p_s_inode->i_sb, 2047 reiserfs_warning(p_s_inode->i_sb, "clm-6000",
2048 "clm-6000: error reading block %lu on dev %s", 2048 "error reading block %lu on dev %s",
2049 bh->b_blocknr, 2049 bh->b_blocknr,
2050 reiserfs_bdevname(p_s_inode->i_sb)); 2050 reiserfs_bdevname(p_s_inode->i_sb));
2051 error = -EIO; 2051 error = -EIO;
@@ -2089,8 +2089,8 @@ int reiserfs_truncate_file(struct inode *p_s_inode, int update_timestamps)
2089 // and get_block_create_0 could not find a block to read in, 2089 // and get_block_create_0 could not find a block to read in,
2090 // which is ok. 2090 // which is ok.
2091 if (error != -ENOENT) 2091 if (error != -ENOENT)
2092 reiserfs_warning(p_s_inode->i_sb, 2092 reiserfs_warning(p_s_inode->i_sb, "clm-6001",
2093 "clm-6001: grab_tail_page failed %d", 2093 "grab_tail_page failed %d",
2094 error); 2094 error);
2095 page = NULL; 2095 page = NULL;
2096 bh = NULL; 2096 bh = NULL;
@@ -2208,9 +2208,8 @@ static int map_block_for_writepage(struct inode *inode,
2208 /* we've found an unformatted node */ 2208 /* we've found an unformatted node */
2209 if (indirect_item_found(retval, ih)) { 2209 if (indirect_item_found(retval, ih)) {
2210 if (bytes_copied > 0) { 2210 if (bytes_copied > 0) {
2211 reiserfs_warning(inode->i_sb, 2211 reiserfs_warning(inode->i_sb, "clm-6002",
2212 "clm-6002: bytes_copied %d", 2212 "bytes_copied %d", bytes_copied);
2213 bytes_copied);
2214 } 2213 }
2215 if (!get_block_num(item, pos_in_item)) { 2214 if (!get_block_num(item, pos_in_item)) {
2216 /* crap, we are writing to a hole */ 2215 /* crap, we are writing to a hole */
@@ -2267,9 +2266,8 @@ static int map_block_for_writepage(struct inode *inode,
2267 goto research; 2266 goto research;
2268 } 2267 }
2269 } else { 2268 } else {
2270 reiserfs_warning(inode->i_sb, 2269 reiserfs_warning(inode->i_sb, "clm-6003",
2271 "clm-6003: bad item inode %lu, device %s", 2270 "bad item inode %lu", inode->i_ino);
2272 inode->i_ino, reiserfs_bdevname(inode->i_sb));
2273 retval = -EIO; 2271 retval = -EIO;
2274 goto out; 2272 goto out;
2275 } 2273 }
diff --git a/fs/reiserfs/item_ops.c b/fs/reiserfs/item_ops.c
index 9475557ab499..8a11cf39f57b 100644
--- a/fs/reiserfs/item_ops.c
+++ b/fs/reiserfs/item_ops.c
@@ -97,7 +97,8 @@ static int sd_unit_num(struct virtual_item *vi)
97 97
98static void sd_print_vi(struct virtual_item *vi) 98static void sd_print_vi(struct virtual_item *vi)
99{ 99{
100 reiserfs_warning(NULL, "STATDATA, index %d, type 0x%x, %h", 100 reiserfs_warning(NULL, "reiserfs-16100",
101 "STATDATA, index %d, type 0x%x, %h",
101 vi->vi_index, vi->vi_type, vi->vi_ih); 102 vi->vi_index, vi->vi_type, vi->vi_ih);
102} 103}
103 104
@@ -190,7 +191,8 @@ static int direct_unit_num(struct virtual_item *vi)
190 191
191static void direct_print_vi(struct virtual_item *vi) 192static void direct_print_vi(struct virtual_item *vi)
192{ 193{
193 reiserfs_warning(NULL, "DIRECT, index %d, type 0x%x, %h", 194 reiserfs_warning(NULL, "reiserfs-16101",
195 "DIRECT, index %d, type 0x%x, %h",
194 vi->vi_index, vi->vi_type, vi->vi_ih); 196 vi->vi_index, vi->vi_type, vi->vi_ih);
195} 197}
196 198
@@ -278,7 +280,7 @@ static void indirect_print_item(struct item_head *ih, char *item)
278 unp = (__le32 *) item; 280 unp = (__le32 *) item;
279 281
280 if (ih_item_len(ih) % UNFM_P_SIZE) 282 if (ih_item_len(ih) % UNFM_P_SIZE)
281 reiserfs_warning(NULL, "indirect_print_item: invalid item len"); 283 reiserfs_warning(NULL, "reiserfs-16102", "invalid item len");
282 284
283 printk("%d pointers\n[ ", (int)I_UNFM_NUM(ih)); 285 printk("%d pointers\n[ ", (int)I_UNFM_NUM(ih));
284 for (j = 0; j < I_UNFM_NUM(ih); j++) { 286 for (j = 0; j < I_UNFM_NUM(ih); j++) {
@@ -334,7 +336,8 @@ static int indirect_unit_num(struct virtual_item *vi)
334 336
335static void indirect_print_vi(struct virtual_item *vi) 337static void indirect_print_vi(struct virtual_item *vi)
336{ 338{
337 reiserfs_warning(NULL, "INDIRECT, index %d, type 0x%x, %h", 339 reiserfs_warning(NULL, "reiserfs-16103",
340 "INDIRECT, index %d, type 0x%x, %h",
338 vi->vi_index, vi->vi_type, vi->vi_ih); 341 vi->vi_index, vi->vi_type, vi->vi_ih);
339} 342}
340 343
@@ -359,7 +362,7 @@ static struct item_operations indirect_ops = {
359 362
360static int direntry_bytes_number(struct item_head *ih, int block_size) 363static int direntry_bytes_number(struct item_head *ih, int block_size)
361{ 364{
362 reiserfs_warning(NULL, "vs-16090: direntry_bytes_number: " 365 reiserfs_warning(NULL, "vs-16090",
363 "bytes number is asked for direntry"); 366 "bytes number is asked for direntry");
364 return 0; 367 return 0;
365} 368}
@@ -614,7 +617,8 @@ static void direntry_print_vi(struct virtual_item *vi)
614 int i; 617 int i;
615 struct direntry_uarea *dir_u = vi->vi_uarea; 618 struct direntry_uarea *dir_u = vi->vi_uarea;
616 619
617 reiserfs_warning(NULL, "DIRENTRY, index %d, type 0x%x, %h, flags 0x%x", 620 reiserfs_warning(NULL, "reiserfs-16104",
621 "DIRENTRY, index %d, type 0x%x, %h, flags 0x%x",
618 vi->vi_index, vi->vi_type, vi->vi_ih, dir_u->flags); 622 vi->vi_index, vi->vi_type, vi->vi_ih, dir_u->flags);
619 printk("%d entries: ", dir_u->entry_count); 623 printk("%d entries: ", dir_u->entry_count);
620 for (i = 0; i < dir_u->entry_count; i++) 624 for (i = 0; i < dir_u->entry_count; i++)
@@ -642,43 +646,43 @@ static struct item_operations direntry_ops = {
642// 646//
643static int errcatch_bytes_number(struct item_head *ih, int block_size) 647static int errcatch_bytes_number(struct item_head *ih, int block_size)
644{ 648{
645 reiserfs_warning(NULL, 649 reiserfs_warning(NULL, "green-16001",
646 "green-16001: Invalid item type observed, run fsck ASAP"); 650 "Invalid item type observed, run fsck ASAP");
647 return 0; 651 return 0;
648} 652}
649 653
650static void errcatch_decrement_key(struct cpu_key *key) 654static void errcatch_decrement_key(struct cpu_key *key)
651{ 655{
652 reiserfs_warning(NULL, 656 reiserfs_warning(NULL, "green-16002",
653 "green-16002: Invalid item type observed, run fsck ASAP"); 657 "Invalid item type observed, run fsck ASAP");
654} 658}
655 659
656static int errcatch_is_left_mergeable(struct reiserfs_key *key, 660static int errcatch_is_left_mergeable(struct reiserfs_key *key,
657 unsigned long bsize) 661 unsigned long bsize)
658{ 662{
659 reiserfs_warning(NULL, 663 reiserfs_warning(NULL, "green-16003",
660 "green-16003: Invalid item type observed, run fsck ASAP"); 664 "Invalid item type observed, run fsck ASAP");
661 return 0; 665 return 0;
662} 666}
663 667
664static void errcatch_print_item(struct item_head *ih, char *item) 668static void errcatch_print_item(struct item_head *ih, char *item)
665{ 669{
666 reiserfs_warning(NULL, 670 reiserfs_warning(NULL, "green-16004",
667 "green-16004: Invalid item type observed, run fsck ASAP"); 671 "Invalid item type observed, run fsck ASAP");
668} 672}
669 673
670static void errcatch_check_item(struct item_head *ih, char *item) 674static void errcatch_check_item(struct item_head *ih, char *item)
671{ 675{
672 reiserfs_warning(NULL, 676 reiserfs_warning(NULL, "green-16005",
673 "green-16005: Invalid item type observed, run fsck ASAP"); 677 "Invalid item type observed, run fsck ASAP");
674} 678}
675 679
676static int errcatch_create_vi(struct virtual_node *vn, 680static int errcatch_create_vi(struct virtual_node *vn,
677 struct virtual_item *vi, 681 struct virtual_item *vi,
678 int is_affected, int insert_size) 682 int is_affected, int insert_size)
679{ 683{
680 reiserfs_warning(NULL, 684 reiserfs_warning(NULL, "green-16006",
681 "green-16006: Invalid item type observed, run fsck ASAP"); 685 "Invalid item type observed, run fsck ASAP");
682 return 0; // We might return -1 here as well, but it won't help as create_virtual_node() from where 686 return 0; // We might return -1 here as well, but it won't help as create_virtual_node() from where
683 // this operation is called from is of return type void. 687 // this operation is called from is of return type void.
684} 688}
@@ -686,36 +690,36 @@ static int errcatch_create_vi(struct virtual_node *vn,
686static int errcatch_check_left(struct virtual_item *vi, int free, 690static int errcatch_check_left(struct virtual_item *vi, int free,
687 int start_skip, int end_skip) 691 int start_skip, int end_skip)
688{ 692{
689 reiserfs_warning(NULL, 693 reiserfs_warning(NULL, "green-16007",
690 "green-16007: Invalid item type observed, run fsck ASAP"); 694 "Invalid item type observed, run fsck ASAP");
691 return -1; 695 return -1;
692} 696}
693 697
694static int errcatch_check_right(struct virtual_item *vi, int free) 698static int errcatch_check_right(struct virtual_item *vi, int free)
695{ 699{
696 reiserfs_warning(NULL, 700 reiserfs_warning(NULL, "green-16008",
697 "green-16008: Invalid item type observed, run fsck ASAP"); 701 "Invalid item type observed, run fsck ASAP");
698 return -1; 702 return -1;
699} 703}
700 704
701static int errcatch_part_size(struct virtual_item *vi, int first, int count) 705static int errcatch_part_size(struct virtual_item *vi, int first, int count)
702{ 706{
703 reiserfs_warning(NULL, 707 reiserfs_warning(NULL, "green-16009",
704 "green-16009: Invalid item type observed, run fsck ASAP"); 708 "Invalid item type observed, run fsck ASAP");
705 return 0; 709 return 0;
706} 710}
707 711
708static int errcatch_unit_num(struct virtual_item *vi) 712static int errcatch_unit_num(struct virtual_item *vi)
709{ 713{
710 reiserfs_warning(NULL, 714 reiserfs_warning(NULL, "green-16010",
711 "green-16010: Invalid item type observed, run fsck ASAP"); 715 "Invalid item type observed, run fsck ASAP");
712 return 0; 716 return 0;
713} 717}
714 718
715static void errcatch_print_vi(struct virtual_item *vi) 719static void errcatch_print_vi(struct virtual_item *vi)
716{ 720{
717 reiserfs_warning(NULL, 721 reiserfs_warning(NULL, "green-16011",
718 "green-16011: Invalid item type observed, run fsck ASAP"); 722 "Invalid item type observed, run fsck ASAP");
719} 723}
720 724
721static struct item_operations errcatch_ops = { 725static struct item_operations errcatch_ops = {
diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c
index 677bb926e7d6..88a031fafd07 100644
--- a/fs/reiserfs/journal.c
+++ b/fs/reiserfs/journal.c
@@ -300,8 +300,8 @@ int reiserfs_allocate_list_bitmaps(struct super_block *p_s_sb,
300 jb->journal_list = NULL; 300 jb->journal_list = NULL;
301 jb->bitmaps = vmalloc(mem); 301 jb->bitmaps = vmalloc(mem);
302 if (!jb->bitmaps) { 302 if (!jb->bitmaps) {
303 reiserfs_warning(p_s_sb, 303 reiserfs_warning(p_s_sb, "clm-2000", "unable to "
304 "clm-2000, unable to allocate bitmaps for journal lists"); 304 "allocate bitmaps for journal lists");
305 failed = 1; 305 failed = 1;
306 break; 306 break;
307 } 307 }
@@ -644,8 +644,8 @@ static void reiserfs_end_buffer_io_sync(struct buffer_head *bh, int uptodate)
644 char b[BDEVNAME_SIZE]; 644 char b[BDEVNAME_SIZE];
645 645
646 if (buffer_journaled(bh)) { 646 if (buffer_journaled(bh)) {
647 reiserfs_warning(NULL, 647 reiserfs_warning(NULL, "clm-2084",
648 "clm-2084: pinned buffer %lu:%s sent to disk", 648 "pinned buffer %lu:%s sent to disk",
649 bh->b_blocknr, bdevname(bh->b_bdev, b)); 649 bh->b_blocknr, bdevname(bh->b_bdev, b));
650 } 650 }
651 if (uptodate) 651 if (uptodate)
@@ -1122,7 +1122,8 @@ static int flush_commit_list(struct super_block *s,
1122 sync_dirty_buffer(tbh); 1122 sync_dirty_buffer(tbh);
1123 if (unlikely(!buffer_uptodate(tbh))) { 1123 if (unlikely(!buffer_uptodate(tbh))) {
1124#ifdef CONFIG_REISERFS_CHECK 1124#ifdef CONFIG_REISERFS_CHECK
1125 reiserfs_warning(s, "journal-601, buffer write failed"); 1125 reiserfs_warning(s, "journal-601",
1126 "buffer write failed");
1126#endif 1127#endif
1127 retval = -EIO; 1128 retval = -EIO;
1128 } 1129 }
@@ -1154,14 +1155,14 @@ static int flush_commit_list(struct super_block *s,
1154 * up propagating the write error out to the filesystem. */ 1155 * up propagating the write error out to the filesystem. */
1155 if (unlikely(!buffer_uptodate(jl->j_commit_bh))) { 1156 if (unlikely(!buffer_uptodate(jl->j_commit_bh))) {
1156#ifdef CONFIG_REISERFS_CHECK 1157#ifdef CONFIG_REISERFS_CHECK
1157 reiserfs_warning(s, "journal-615: buffer write failed"); 1158 reiserfs_warning(s, "journal-615", "buffer write failed");
1158#endif 1159#endif
1159 retval = -EIO; 1160 retval = -EIO;
1160 } 1161 }
1161 bforget(jl->j_commit_bh); 1162 bforget(jl->j_commit_bh);
1162 if (journal->j_last_commit_id != 0 && 1163 if (journal->j_last_commit_id != 0 &&
1163 (jl->j_trans_id - journal->j_last_commit_id) != 1) { 1164 (jl->j_trans_id - journal->j_last_commit_id) != 1) {
1164 reiserfs_warning(s, "clm-2200: last commit %lu, current %lu", 1165 reiserfs_warning(s, "clm-2200", "last commit %lu, current %lu",
1165 journal->j_last_commit_id, jl->j_trans_id); 1166 journal->j_last_commit_id, jl->j_trans_id);
1166 } 1167 }
1167 journal->j_last_commit_id = jl->j_trans_id; 1168 journal->j_last_commit_id = jl->j_trans_id;
@@ -1250,7 +1251,7 @@ static void remove_all_from_journal_list(struct super_block *p_s_sb,
1250 while (cn) { 1251 while (cn) {
1251 if (cn->blocknr != 0) { 1252 if (cn->blocknr != 0) {
1252 if (debug) { 1253 if (debug) {
1253 reiserfs_warning(p_s_sb, 1254 reiserfs_warning(p_s_sb, "reiserfs-2201",
1254 "block %u, bh is %d, state %ld", 1255 "block %u, bh is %d, state %ld",
1255 cn->blocknr, cn->bh ? 1 : 0, 1256 cn->blocknr, cn->bh ? 1 : 0,
1256 cn->state); 1257 cn->state);
@@ -1288,8 +1289,8 @@ static int _update_journal_header_block(struct super_block *p_s_sb,
1288 wait_on_buffer((journal->j_header_bh)); 1289 wait_on_buffer((journal->j_header_bh));
1289 if (unlikely(!buffer_uptodate(journal->j_header_bh))) { 1290 if (unlikely(!buffer_uptodate(journal->j_header_bh))) {
1290#ifdef CONFIG_REISERFS_CHECK 1291#ifdef CONFIG_REISERFS_CHECK
1291 reiserfs_warning(p_s_sb, 1292 reiserfs_warning(p_s_sb, "journal-699",
1292 "journal-699: buffer write failed"); 1293 "buffer write failed");
1293#endif 1294#endif
1294 return -EIO; 1295 return -EIO;
1295 } 1296 }
@@ -1319,8 +1320,8 @@ static int _update_journal_header_block(struct super_block *p_s_sb,
1319 sync_dirty_buffer(journal->j_header_bh); 1320 sync_dirty_buffer(journal->j_header_bh);
1320 } 1321 }
1321 if (!buffer_uptodate(journal->j_header_bh)) { 1322 if (!buffer_uptodate(journal->j_header_bh)) {
1322 reiserfs_warning(p_s_sb, 1323 reiserfs_warning(p_s_sb, "journal-837",
1323 "journal-837: IO error during journal replay"); 1324 "IO error during journal replay");
1324 return -EIO; 1325 return -EIO;
1325 } 1326 }
1326 } 1327 }
@@ -1401,8 +1402,7 @@ static int flush_journal_list(struct super_block *s,
1401 BUG_ON(j_len_saved <= 0); 1402 BUG_ON(j_len_saved <= 0);
1402 1403
1403 if (atomic_read(&journal->j_wcount) != 0) { 1404 if (atomic_read(&journal->j_wcount) != 0) {
1404 reiserfs_warning(s, 1405 reiserfs_warning(s, "clm-2048", "called with wcount %d",
1405 "clm-2048: flush_journal_list called with wcount %d",
1406 atomic_read(&journal->j_wcount)); 1406 atomic_read(&journal->j_wcount));
1407 } 1407 }
1408 BUG_ON(jl->j_trans_id == 0); 1408 BUG_ON(jl->j_trans_id == 0);
@@ -1510,8 +1510,8 @@ static int flush_journal_list(struct super_block *s,
1510 ** is not marked JDirty_wait 1510 ** is not marked JDirty_wait
1511 */ 1511 */
1512 if ((!was_jwait) && !buffer_locked(saved_bh)) { 1512 if ((!was_jwait) && !buffer_locked(saved_bh)) {
1513 reiserfs_warning(s, 1513 reiserfs_warning(s, "journal-813",
1514 "journal-813: BAD! buffer %llu %cdirty %cjwait, " 1514 "BAD! buffer %llu %cdirty %cjwait, "
1515 "not in a newer tranasction", 1515 "not in a newer tranasction",
1516 (unsigned long long)saved_bh-> 1516 (unsigned long long)saved_bh->
1517 b_blocknr, was_dirty ? ' ' : '!', 1517 b_blocknr, was_dirty ? ' ' : '!',
@@ -1529,8 +1529,8 @@ static int flush_journal_list(struct super_block *s,
1529 unlock_buffer(saved_bh); 1529 unlock_buffer(saved_bh);
1530 count++; 1530 count++;
1531 } else { 1531 } else {
1532 reiserfs_warning(s, 1532 reiserfs_warning(s, "clm-2082",
1533 "clm-2082: Unable to flush buffer %llu in %s", 1533 "Unable to flush buffer %llu in %s",
1534 (unsigned long long)saved_bh-> 1534 (unsigned long long)saved_bh->
1535 b_blocknr, __func__); 1535 b_blocknr, __func__);
1536 } 1536 }
@@ -1541,8 +1541,8 @@ static int flush_journal_list(struct super_block *s,
1541 /* we incremented this to keep others from taking the buffer head away */ 1541 /* we incremented this to keep others from taking the buffer head away */
1542 put_bh(saved_bh); 1542 put_bh(saved_bh);
1543 if (atomic_read(&(saved_bh->b_count)) < 0) { 1543 if (atomic_read(&(saved_bh->b_count)) < 0) {
1544 reiserfs_warning(s, 1544 reiserfs_warning(s, "journal-945",
1545 "journal-945: saved_bh->b_count < 0"); 1545 "saved_bh->b_count < 0");
1546 } 1546 }
1547 } 1547 }
1548 } 1548 }
@@ -1561,8 +1561,8 @@ static int flush_journal_list(struct super_block *s,
1561 } 1561 }
1562 if (unlikely(!buffer_uptodate(cn->bh))) { 1562 if (unlikely(!buffer_uptodate(cn->bh))) {
1563#ifdef CONFIG_REISERFS_CHECK 1563#ifdef CONFIG_REISERFS_CHECK
1564 reiserfs_warning(s, 1564 reiserfs_warning(s, "journal-949",
1565 "journal-949: buffer write failed\n"); 1565 "buffer write failed");
1566#endif 1566#endif
1567 err = -EIO; 1567 err = -EIO;
1568 } 1568 }
@@ -1623,7 +1623,7 @@ static int flush_journal_list(struct super_block *s,
1623 1623
1624 if (journal->j_last_flush_id != 0 && 1624 if (journal->j_last_flush_id != 0 &&
1625 (jl->j_trans_id - journal->j_last_flush_id) != 1) { 1625 (jl->j_trans_id - journal->j_last_flush_id) != 1) {
1626 reiserfs_warning(s, "clm-2201: last flush %lu, current %lu", 1626 reiserfs_warning(s, "clm-2201", "last flush %lu, current %lu",
1627 journal->j_last_flush_id, jl->j_trans_id); 1627 journal->j_last_flush_id, jl->j_trans_id);
1628 } 1628 }
1629 journal->j_last_flush_id = jl->j_trans_id; 1629 journal->j_last_flush_id = jl->j_trans_id;
@@ -2058,8 +2058,9 @@ static int journal_transaction_is_valid(struct super_block *p_s_sb,
2058 return -1; 2058 return -1;
2059 } 2059 }
2060 if (get_desc_trans_len(desc) > SB_JOURNAL(p_s_sb)->j_trans_max) { 2060 if (get_desc_trans_len(desc) > SB_JOURNAL(p_s_sb)->j_trans_max) {
2061 reiserfs_warning(p_s_sb, 2061 reiserfs_warning(p_s_sb, "journal-2018",
2062 "journal-2018: Bad transaction length %d encountered, ignoring transaction", 2062 "Bad transaction length %d "
2063 "encountered, ignoring transaction",
2063 get_desc_trans_len(desc)); 2064 get_desc_trans_len(desc));
2064 return -1; 2065 return -1;
2065 } 2066 }
@@ -2195,8 +2196,8 @@ static int journal_read_transaction(struct super_block *p_s_sb,
2195 brelse(d_bh); 2196 brelse(d_bh);
2196 kfree(log_blocks); 2197 kfree(log_blocks);
2197 kfree(real_blocks); 2198 kfree(real_blocks);
2198 reiserfs_warning(p_s_sb, 2199 reiserfs_warning(p_s_sb, "journal-1169",
2199 "journal-1169: kmalloc failed, unable to mount FS"); 2200 "kmalloc failed, unable to mount FS");
2200 return -1; 2201 return -1;
2201 } 2202 }
2202 /* get all the buffer heads */ 2203 /* get all the buffer heads */
@@ -2218,15 +2219,18 @@ static int journal_read_transaction(struct super_block *p_s_sb,
2218 j_realblock[i - trans_half])); 2219 j_realblock[i - trans_half]));
2219 } 2220 }
2220 if (real_blocks[i]->b_blocknr > SB_BLOCK_COUNT(p_s_sb)) { 2221 if (real_blocks[i]->b_blocknr > SB_BLOCK_COUNT(p_s_sb)) {
2221 reiserfs_warning(p_s_sb, 2222 reiserfs_warning(p_s_sb, "journal-1207",
2222 "journal-1207: REPLAY FAILURE fsck required! Block to replay is outside of filesystem"); 2223 "REPLAY FAILURE fsck required! "
2224 "Block to replay is outside of "
2225 "filesystem");
2223 goto abort_replay; 2226 goto abort_replay;
2224 } 2227 }
2225 /* make sure we don't try to replay onto log or reserved area */ 2228 /* make sure we don't try to replay onto log or reserved area */
2226 if (is_block_in_log_or_reserved_area 2229 if (is_block_in_log_or_reserved_area
2227 (p_s_sb, real_blocks[i]->b_blocknr)) { 2230 (p_s_sb, real_blocks[i]->b_blocknr)) {
2228 reiserfs_warning(p_s_sb, 2231 reiserfs_warning(p_s_sb, "journal-1204",
2229 "journal-1204: REPLAY FAILURE fsck required! Trying to replay onto a log block"); 2232 "REPLAY FAILURE fsck required! "
2233 "Trying to replay onto a log block");
2230 abort_replay: 2234 abort_replay:
2231 brelse_array(log_blocks, i); 2235 brelse_array(log_blocks, i);
2232 brelse_array(real_blocks, i); 2236 brelse_array(real_blocks, i);
@@ -2242,8 +2246,9 @@ static int journal_read_transaction(struct super_block *p_s_sb,
2242 for (i = 0; i < get_desc_trans_len(desc); i++) { 2246 for (i = 0; i < get_desc_trans_len(desc); i++) {
2243 wait_on_buffer(log_blocks[i]); 2247 wait_on_buffer(log_blocks[i]);
2244 if (!buffer_uptodate(log_blocks[i])) { 2248 if (!buffer_uptodate(log_blocks[i])) {
2245 reiserfs_warning(p_s_sb, 2249 reiserfs_warning(p_s_sb, "journal-1212",
2246 "journal-1212: REPLAY FAILURE fsck required! buffer write failed"); 2250 "REPLAY FAILURE fsck required! "
2251 "buffer write failed");
2247 brelse_array(log_blocks + i, 2252 brelse_array(log_blocks + i,
2248 get_desc_trans_len(desc) - i); 2253 get_desc_trans_len(desc) - i);
2249 brelse_array(real_blocks, get_desc_trans_len(desc)); 2254 brelse_array(real_blocks, get_desc_trans_len(desc));
@@ -2266,8 +2271,9 @@ static int journal_read_transaction(struct super_block *p_s_sb,
2266 for (i = 0; i < get_desc_trans_len(desc); i++) { 2271 for (i = 0; i < get_desc_trans_len(desc); i++) {
2267 wait_on_buffer(real_blocks[i]); 2272 wait_on_buffer(real_blocks[i]);
2268 if (!buffer_uptodate(real_blocks[i])) { 2273 if (!buffer_uptodate(real_blocks[i])) {
2269 reiserfs_warning(p_s_sb, 2274 reiserfs_warning(p_s_sb, "journal-1226",
2270 "journal-1226: REPLAY FAILURE, fsck required! buffer write failed"); 2275 "REPLAY FAILURE, fsck required! "
2276 "buffer write failed");
2271 brelse_array(real_blocks + i, 2277 brelse_array(real_blocks + i,
2272 get_desc_trans_len(desc) - i); 2278 get_desc_trans_len(desc) - i);
2273 brelse(c_bh); 2279 brelse(c_bh);
@@ -2418,8 +2424,8 @@ static int journal_read(struct super_block *p_s_sb)
2418 } 2424 }
2419 2425
2420 if (continue_replay && bdev_read_only(p_s_sb->s_bdev)) { 2426 if (continue_replay && bdev_read_only(p_s_sb->s_bdev)) {
2421 reiserfs_warning(p_s_sb, 2427 reiserfs_warning(p_s_sb, "clm-2076",
2422 "clm-2076: device is readonly, unable to replay log"); 2428 "device is readonly, unable to replay log");
2423 return -1; 2429 return -1;
2424 } 2430 }
2425 2431
@@ -2580,9 +2586,8 @@ static int release_journal_dev(struct super_block *super,
2580 } 2586 }
2581 2587
2582 if (result != 0) { 2588 if (result != 0) {
2583 reiserfs_warning(super, 2589 reiserfs_warning(super, "sh-457",
2584 "sh-457: release_journal_dev: Cannot release journal device: %i", 2590 "Cannot release journal device: %i", result);
2585 result);
2586 } 2591 }
2587 return result; 2592 return result;
2588} 2593}
@@ -2612,7 +2617,7 @@ static int journal_init_dev(struct super_block *super,
2612 if (IS_ERR(journal->j_dev_bd)) { 2617 if (IS_ERR(journal->j_dev_bd)) {
2613 result = PTR_ERR(journal->j_dev_bd); 2618 result = PTR_ERR(journal->j_dev_bd);
2614 journal->j_dev_bd = NULL; 2619 journal->j_dev_bd = NULL;
2615 reiserfs_warning(super, "sh-458: journal_init_dev: " 2620 reiserfs_warning(super, "sh-458",
2616 "cannot init journal device '%s': %i", 2621 "cannot init journal device '%s': %i",
2617 __bdevname(jdev, b), result); 2622 __bdevname(jdev, b), result);
2618 return result; 2623 return result;
@@ -2676,16 +2681,16 @@ static int check_advise_trans_params(struct super_block *p_s_sb,
2676 journal->j_trans_max < JOURNAL_TRANS_MIN_DEFAULT / ratio || 2681 journal->j_trans_max < JOURNAL_TRANS_MIN_DEFAULT / ratio ||
2677 SB_ONDISK_JOURNAL_SIZE(p_s_sb) / journal->j_trans_max < 2682 SB_ONDISK_JOURNAL_SIZE(p_s_sb) / journal->j_trans_max <
2678 JOURNAL_MIN_RATIO) { 2683 JOURNAL_MIN_RATIO) {
2679 reiserfs_warning(p_s_sb, 2684 reiserfs_warning(p_s_sb, "sh-462",
2680 "sh-462: bad transaction max size (%u). FSCK?", 2685 "bad transaction max size (%u). "
2681 journal->j_trans_max); 2686 "FSCK?", journal->j_trans_max);
2682 return 1; 2687 return 1;
2683 } 2688 }
2684 if (journal->j_max_batch != (journal->j_trans_max) * 2689 if (journal->j_max_batch != (journal->j_trans_max) *
2685 JOURNAL_MAX_BATCH_DEFAULT/JOURNAL_TRANS_MAX_DEFAULT) { 2690 JOURNAL_MAX_BATCH_DEFAULT/JOURNAL_TRANS_MAX_DEFAULT) {
2686 reiserfs_warning(p_s_sb, 2691 reiserfs_warning(p_s_sb, "sh-463",
2687 "sh-463: bad transaction max batch (%u). FSCK?", 2692 "bad transaction max batch (%u). "
2688 journal->j_max_batch); 2693 "FSCK?", journal->j_max_batch);
2689 return 1; 2694 return 1;
2690 } 2695 }
2691 } else { 2696 } else {
@@ -2693,9 +2698,11 @@ static int check_advise_trans_params(struct super_block *p_s_sb,
2693 The file system was created by old version 2698 The file system was created by old version
2694 of mkreiserfs, so some fields contain zeros, 2699 of mkreiserfs, so some fields contain zeros,
2695 and we need to advise proper values for them */ 2700 and we need to advise proper values for them */
2696 if (p_s_sb->s_blocksize != REISERFS_STANDARD_BLKSIZE) 2701 if (p_s_sb->s_blocksize != REISERFS_STANDARD_BLKSIZE) {
2697 reiserfs_panic(p_s_sb, "sh-464: bad blocksize (%u)", 2702 reiserfs_warning(p_s_sb, "sh-464", "bad blocksize (%u)",
2698 p_s_sb->s_blocksize); 2703 p_s_sb->s_blocksize);
2704 return 1;
2705 }
2699 journal->j_trans_max = JOURNAL_TRANS_MAX_DEFAULT; 2706 journal->j_trans_max = JOURNAL_TRANS_MAX_DEFAULT;
2700 journal->j_max_batch = JOURNAL_MAX_BATCH_DEFAULT; 2707 journal->j_max_batch = JOURNAL_MAX_BATCH_DEFAULT;
2701 journal->j_max_commit_age = JOURNAL_MAX_COMMIT_AGE; 2708 journal->j_max_commit_age = JOURNAL_MAX_COMMIT_AGE;
@@ -2719,8 +2726,8 @@ int journal_init(struct super_block *p_s_sb, const char *j_dev_name,
2719 2726
2720 journal = SB_JOURNAL(p_s_sb) = vmalloc(sizeof(struct reiserfs_journal)); 2727 journal = SB_JOURNAL(p_s_sb) = vmalloc(sizeof(struct reiserfs_journal));
2721 if (!journal) { 2728 if (!journal) {
2722 reiserfs_warning(p_s_sb, 2729 reiserfs_warning(p_s_sb, "journal-1256",
2723 "journal-1256: unable to get memory for journal structure"); 2730 "unable to get memory for journal structure");
2724 return 1; 2731 return 1;
2725 } 2732 }
2726 memset(journal, 0, sizeof(struct reiserfs_journal)); 2733 memset(journal, 0, sizeof(struct reiserfs_journal));
@@ -2749,9 +2756,9 @@ int journal_init(struct super_block *p_s_sb, const char *j_dev_name,
2749 if (!SB_ONDISK_JOURNAL_DEVICE(p_s_sb) && 2756 if (!SB_ONDISK_JOURNAL_DEVICE(p_s_sb) &&
2750 (SB_JOURNAL_1st_RESERVED_BLOCK(p_s_sb) + 2757 (SB_JOURNAL_1st_RESERVED_BLOCK(p_s_sb) +
2751 SB_ONDISK_JOURNAL_SIZE(p_s_sb) > p_s_sb->s_blocksize * 8)) { 2758 SB_ONDISK_JOURNAL_SIZE(p_s_sb) > p_s_sb->s_blocksize * 8)) {
2752 reiserfs_warning(p_s_sb, 2759 reiserfs_warning(p_s_sb, "journal-1393",
2753 "journal-1393: journal does not fit for area " 2760 "journal does not fit for area addressed "
2754 "addressed by first of bitmap blocks. It starts at " 2761 "by first of bitmap blocks. It starts at "
2755 "%u and its size is %u. Block size %ld", 2762 "%u and its size is %u. Block size %ld",
2756 SB_JOURNAL_1st_RESERVED_BLOCK(p_s_sb), 2763 SB_JOURNAL_1st_RESERVED_BLOCK(p_s_sb),
2757 SB_ONDISK_JOURNAL_SIZE(p_s_sb), 2764 SB_ONDISK_JOURNAL_SIZE(p_s_sb),
@@ -2760,8 +2767,8 @@ int journal_init(struct super_block *p_s_sb, const char *j_dev_name,
2760 } 2767 }
2761 2768
2762 if (journal_init_dev(p_s_sb, journal, j_dev_name) != 0) { 2769 if (journal_init_dev(p_s_sb, journal, j_dev_name) != 0) {
2763 reiserfs_warning(p_s_sb, 2770 reiserfs_warning(p_s_sb, "sh-462",
2764 "sh-462: unable to initialize jornal device"); 2771 "unable to initialize jornal device");
2765 goto free_and_return; 2772 goto free_and_return;
2766 } 2773 }
2767 2774
@@ -2772,8 +2779,8 @@ int journal_init(struct super_block *p_s_sb, const char *j_dev_name,
2772 SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb) + 2779 SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb) +
2773 SB_ONDISK_JOURNAL_SIZE(p_s_sb)); 2780 SB_ONDISK_JOURNAL_SIZE(p_s_sb));
2774 if (!bhjh) { 2781 if (!bhjh) {
2775 reiserfs_warning(p_s_sb, 2782 reiserfs_warning(p_s_sb, "sh-459",
2776 "sh-459: unable to read journal header"); 2783 "unable to read journal header");
2777 goto free_and_return; 2784 goto free_and_return;
2778 } 2785 }
2779 jh = (struct reiserfs_journal_header *)(bhjh->b_data); 2786 jh = (struct reiserfs_journal_header *)(bhjh->b_data);
@@ -2782,10 +2789,10 @@ int journal_init(struct super_block *p_s_sb, const char *j_dev_name,
2782 if (is_reiserfs_jr(rs) 2789 if (is_reiserfs_jr(rs)
2783 && (le32_to_cpu(jh->jh_journal.jp_journal_magic) != 2790 && (le32_to_cpu(jh->jh_journal.jp_journal_magic) !=
2784 sb_jp_journal_magic(rs))) { 2791 sb_jp_journal_magic(rs))) {
2785 reiserfs_warning(p_s_sb, 2792 reiserfs_warning(p_s_sb, "sh-460",
2786 "sh-460: journal header magic %x " 2793 "journal header magic %x (device %s) does "
2787 "(device %s) does not match to magic found in super " 2794 "not match to magic found in super block %x",
2788 "block %x", jh->jh_journal.jp_journal_magic, 2795 jh->jh_journal.jp_journal_magic,
2789 bdevname(journal->j_dev_bd, b), 2796 bdevname(journal->j_dev_bd, b),
2790 sb_jp_journal_magic(rs)); 2797 sb_jp_journal_magic(rs));
2791 brelse(bhjh); 2798 brelse(bhjh);
@@ -2852,7 +2859,7 @@ int journal_init(struct super_block *p_s_sb, const char *j_dev_name,
2852 journal->j_must_wait = 0; 2859 journal->j_must_wait = 0;
2853 2860
2854 if (journal->j_cnode_free == 0) { 2861 if (journal->j_cnode_free == 0) {
2855 reiserfs_warning(p_s_sb, "journal-2004: Journal cnode memory " 2862 reiserfs_warning(p_s_sb, "journal-2004", "Journal cnode memory "
2856 "allocation failed (%ld bytes). Journal is " 2863 "allocation failed (%ld bytes). Journal is "
2857 "too large for available memory. Usually " 2864 "too large for available memory. Usually "
2858 "this is due to a journal that is too large.", 2865 "this is due to a journal that is too large.",
@@ -2864,12 +2871,13 @@ int journal_init(struct super_block *p_s_sb, const char *j_dev_name,
2864 jl = journal->j_current_jl; 2871 jl = journal->j_current_jl;
2865 jl->j_list_bitmap = get_list_bitmap(p_s_sb, jl); 2872 jl->j_list_bitmap = get_list_bitmap(p_s_sb, jl);
2866 if (!jl->j_list_bitmap) { 2873 if (!jl->j_list_bitmap) {
2867 reiserfs_warning(p_s_sb, 2874 reiserfs_warning(p_s_sb, "journal-2005",
2868 "journal-2005, get_list_bitmap failed for journal list 0"); 2875 "get_list_bitmap failed for journal list 0");
2869 goto free_and_return; 2876 goto free_and_return;
2870 } 2877 }
2871 if (journal_read(p_s_sb) < 0) { 2878 if (journal_read(p_s_sb) < 0) {
2872 reiserfs_warning(p_s_sb, "Replay Failure, unable to mount"); 2879 reiserfs_warning(p_s_sb, "reiserfs-2006",
2880 "Replay Failure, unable to mount");
2873 goto free_and_return; 2881 goto free_and_return;
2874 } 2882 }
2875 2883
@@ -3196,16 +3204,17 @@ int journal_begin(struct reiserfs_transaction_handle *th,
3196 cur_th->t_refcount++; 3204 cur_th->t_refcount++;
3197 memcpy(th, cur_th, sizeof(*th)); 3205 memcpy(th, cur_th, sizeof(*th));
3198 if (th->t_refcount <= 1) 3206 if (th->t_refcount <= 1)
3199 reiserfs_warning(p_s_sb, 3207 reiserfs_warning(p_s_sb, "reiserfs-2005",
3200 "BAD: refcount <= 1, but journal_info != 0"); 3208 "BAD: refcount <= 1, but "
3209 "journal_info != 0");
3201 return 0; 3210 return 0;
3202 } else { 3211 } else {
3203 /* we've ended up with a handle from a different filesystem. 3212 /* we've ended up with a handle from a different filesystem.
3204 ** save it and restore on journal_end. This should never 3213 ** save it and restore on journal_end. This should never
3205 ** really happen... 3214 ** really happen...
3206 */ 3215 */
3207 reiserfs_warning(p_s_sb, 3216 reiserfs_warning(p_s_sb, "clm-2100",
3208 "clm-2100: nesting info a different FS"); 3217 "nesting info a different FS");
3209 th->t_handle_save = current->journal_info; 3218 th->t_handle_save = current->journal_info;
3210 current->journal_info = th; 3219 current->journal_info = th;
3211 } 3220 }
@@ -3266,7 +3275,8 @@ int journal_mark_dirty(struct reiserfs_transaction_handle *th,
3266 ** could get to disk too early. NOT GOOD. 3275 ** could get to disk too early. NOT GOOD.
3267 */ 3276 */
3268 if (!prepared || buffer_dirty(bh)) { 3277 if (!prepared || buffer_dirty(bh)) {
3269 reiserfs_warning(p_s_sb, "journal-1777: buffer %llu bad state " 3278 reiserfs_warning(p_s_sb, "journal-1777",
3279 "buffer %llu bad state "
3270 "%cPREPARED %cLOCKED %cDIRTY %cJDIRTY_WAIT", 3280 "%cPREPARED %cLOCKED %cDIRTY %cJDIRTY_WAIT",
3271 (unsigned long long)bh->b_blocknr, 3281 (unsigned long long)bh->b_blocknr,
3272 prepared ? ' ' : '!', 3282 prepared ? ' ' : '!',
@@ -3276,8 +3286,8 @@ int journal_mark_dirty(struct reiserfs_transaction_handle *th,
3276 } 3286 }
3277 3287
3278 if (atomic_read(&(journal->j_wcount)) <= 0) { 3288 if (atomic_read(&(journal->j_wcount)) <= 0) {
3279 reiserfs_warning(p_s_sb, 3289 reiserfs_warning(p_s_sb, "journal-1409",
3280 "journal-1409: journal_mark_dirty returning because j_wcount was %d", 3290 "returning because j_wcount was %d",
3281 atomic_read(&(journal->j_wcount))); 3291 atomic_read(&(journal->j_wcount)));
3282 return 1; 3292 return 1;
3283 } 3293 }
@@ -3342,8 +3352,8 @@ int journal_end(struct reiserfs_transaction_handle *th,
3342 struct super_block *p_s_sb, unsigned long nblocks) 3352 struct super_block *p_s_sb, unsigned long nblocks)
3343{ 3353{
3344 if (!current->journal_info && th->t_refcount > 1) 3354 if (!current->journal_info && th->t_refcount > 1)
3345 reiserfs_warning(p_s_sb, "REISER-NESTING: th NULL, refcount %d", 3355 reiserfs_warning(p_s_sb, "REISER-NESTING",
3346 th->t_refcount); 3356 "th NULL, refcount %d", th->t_refcount);
3347 3357
3348 if (!th->t_trans_id) { 3358 if (!th->t_trans_id) {
3349 WARN_ON(1); 3359 WARN_ON(1);
@@ -3413,8 +3423,8 @@ static int remove_from_transaction(struct super_block *p_s_sb,
3413 clear_buffer_journal_test(bh); 3423 clear_buffer_journal_test(bh);
3414 put_bh(bh); 3424 put_bh(bh);
3415 if (atomic_read(&(bh->b_count)) < 0) { 3425 if (atomic_read(&(bh->b_count)) < 0) {
3416 reiserfs_warning(p_s_sb, 3426 reiserfs_warning(p_s_sb, "journal-1752",
3417 "journal-1752: remove from trans, b_count < 0"); 3427 "b_count < 0");
3418 } 3428 }
3419 ret = 1; 3429 ret = 1;
3420 } 3430 }
@@ -3734,7 +3744,8 @@ int journal_mark_freed(struct reiserfs_transaction_handle *th,
3734 if (atomic_read 3744 if (atomic_read
3735 (&(cn->bh->b_count)) < 0) { 3745 (&(cn->bh->b_count)) < 0) {
3736 reiserfs_warning(p_s_sb, 3746 reiserfs_warning(p_s_sb,
3737 "journal-2138: cn->bh->b_count < 0"); 3747 "journal-2138",
3748 "cn->bh->b_count < 0");
3738 } 3749 }
3739 } 3750 }
3740 if (cn->jlist) { /* since we are clearing the bh, we MUST dec nonzerolen */ 3751 if (cn->jlist) { /* since we are clearing the bh, we MUST dec nonzerolen */
@@ -4137,8 +4148,9 @@ static int do_journal_end(struct reiserfs_transaction_handle *th,
4137 clear_buffer_journaled(cn->bh); 4148 clear_buffer_journaled(cn->bh);
4138 } else { 4149 } else {
4139 /* JDirty cleared sometime during transaction. don't log this one */ 4150 /* JDirty cleared sometime during transaction. don't log this one */
4140 reiserfs_warning(p_s_sb, 4151 reiserfs_warning(p_s_sb, "journal-2048",
4141 "journal-2048: do_journal_end: BAD, buffer in journal hash, but not JDirty!"); 4152 "BAD, buffer in journal hash, "
4153 "but not JDirty!");
4142 brelse(cn->bh); 4154 brelse(cn->bh);
4143 } 4155 }
4144 next = cn->next; 4156 next = cn->next;
diff --git a/fs/reiserfs/lbalance.c b/fs/reiserfs/lbalance.c
index 41bdd8c75887..381339b432e7 100644
--- a/fs/reiserfs/lbalance.c
+++ b/fs/reiserfs/lbalance.c
@@ -1288,12 +1288,16 @@ void leaf_paste_entries(struct buffer_info *bi,
1288 prev = (i != 0) ? deh_location(&(deh[i - 1])) : 0; 1288 prev = (i != 0) ? deh_location(&(deh[i - 1])) : 0;
1289 1289
1290 if (prev && prev <= deh_location(&(deh[i]))) 1290 if (prev && prev <= deh_location(&(deh[i])))
1291 reiserfs_warning(NULL, 1291 reiserfs_warning(NULL, "vs-10240",
1292 "vs-10240: leaf_paste_entries: directory item (%h) corrupted (prev %a, cur(%d) %a)", 1292 "directory item (%h) "
1293 "corrupted (prev %a, "
1294 "cur(%d) %a)",
1293 ih, deh + i - 1, i, deh + i); 1295 ih, deh + i - 1, i, deh + i);
1294 if (next && next >= deh_location(&(deh[i]))) 1296 if (next && next >= deh_location(&(deh[i])))
1295 reiserfs_warning(NULL, 1297 reiserfs_warning(NULL, "vs-10250",
1296 "vs-10250: leaf_paste_entries: directory item (%h) corrupted (cur(%d) %a, next %a)", 1298 "directory item (%h) "
1299 "corrupted (cur(%d) %a, "
1300 "next %a)",
1297 ih, i, deh + i, deh + i + 1); 1301 ih, i, deh + i, deh + i + 1);
1298 } 1302 }
1299 } 1303 }
diff --git a/fs/reiserfs/namei.c b/fs/reiserfs/namei.c
index 738967f6c8ee..bb41c6e7c79b 100644
--- a/fs/reiserfs/namei.c
+++ b/fs/reiserfs/namei.c
@@ -120,8 +120,8 @@ int search_by_entry_key(struct super_block *sb, const struct cpu_key *key,
120 switch (retval) { 120 switch (retval) {
121 case ITEM_NOT_FOUND: 121 case ITEM_NOT_FOUND:
122 if (!PATH_LAST_POSITION(path)) { 122 if (!PATH_LAST_POSITION(path)) {
123 reiserfs_warning(sb, 123 reiserfs_warning(sb, "vs-7000", "search_by_key "
124 "vs-7000: search_by_entry_key: search_by_key returned item position == 0"); 124 "returned item position == 0");
125 pathrelse(path); 125 pathrelse(path);
126 return IO_ERROR; 126 return IO_ERROR;
127 } 127 }
@@ -135,8 +135,7 @@ int search_by_entry_key(struct super_block *sb, const struct cpu_key *key,
135 135
136 default: 136 default:
137 pathrelse(path); 137 pathrelse(path);
138 reiserfs_warning(sb, 138 reiserfs_warning(sb, "vs-7002", "no path to here");
139 "vs-7002: search_by_entry_key: no path to here");
140 return IO_ERROR; 139 return IO_ERROR;
141 } 140 }
142 141
@@ -300,8 +299,7 @@ static int reiserfs_find_entry(struct inode *dir, const char *name, int namelen,
300 search_by_entry_key(dir->i_sb, &key_to_search, 299 search_by_entry_key(dir->i_sb, &key_to_search,
301 path_to_entry, de); 300 path_to_entry, de);
302 if (retval == IO_ERROR) { 301 if (retval == IO_ERROR) {
303 reiserfs_warning(dir->i_sb, "zam-7001: io error in %s", 302 reiserfs_warning(dir->i_sb, "zam-7001", "io error");
304 __func__);
305 return IO_ERROR; 303 return IO_ERROR;
306 } 304 }
307 305
@@ -484,10 +482,9 @@ static int reiserfs_add_entry(struct reiserfs_transaction_handle *th,
484 } 482 }
485 483
486 if (retval != NAME_FOUND) { 484 if (retval != NAME_FOUND) {
487 reiserfs_warning(dir->i_sb, 485 reiserfs_warning(dir->i_sb, "zam-7002",
488 "zam-7002:%s: \"reiserfs_find_entry\" " 486 "reiserfs_find_entry() returned "
489 "has returned unexpected value (%d)", 487 "unexpected value (%d)", retval);
490 __func__, retval);
491 } 488 }
492 489
493 return -EEXIST; 490 return -EEXIST;
@@ -498,8 +495,9 @@ static int reiserfs_add_entry(struct reiserfs_transaction_handle *th,
498 MAX_GENERATION_NUMBER + 1); 495 MAX_GENERATION_NUMBER + 1);
499 if (gen_number > MAX_GENERATION_NUMBER) { 496 if (gen_number > MAX_GENERATION_NUMBER) {
500 /* there is no free generation number */ 497 /* there is no free generation number */
501 reiserfs_warning(dir->i_sb, 498 reiserfs_warning(dir->i_sb, "reiserfs-7010",
502 "reiserfs_add_entry: Congratulations! we have got hash function screwed up"); 499 "Congratulations! we have got hash function "
500 "screwed up");
503 if (buffer != small_buf) 501 if (buffer != small_buf)
504 kfree(buffer); 502 kfree(buffer);
505 pathrelse(&path); 503 pathrelse(&path);
@@ -515,10 +513,9 @@ static int reiserfs_add_entry(struct reiserfs_transaction_handle *th,
515 if (gen_number != 0) { /* we need to re-search for the insertion point */ 513 if (gen_number != 0) { /* we need to re-search for the insertion point */
516 if (search_by_entry_key(dir->i_sb, &entry_key, &path, &de) != 514 if (search_by_entry_key(dir->i_sb, &entry_key, &path, &de) !=
517 NAME_NOT_FOUND) { 515 NAME_NOT_FOUND) {
518 reiserfs_warning(dir->i_sb, 516 reiserfs_warning(dir->i_sb, "vs-7032",
519 "vs-7032: reiserfs_add_entry: " 517 "entry with this key (%K) already "
520 "entry with this key (%K) already exists", 518 "exists", &entry_key);
521 &entry_key);
522 519
523 if (buffer != small_buf) 520 if (buffer != small_buf)
524 kfree(buffer); 521 kfree(buffer);
@@ -903,8 +900,9 @@ static int reiserfs_rmdir(struct inode *dir, struct dentry *dentry)
903 goto end_rmdir; 900 goto end_rmdir;
904 901
905 if (inode->i_nlink != 2 && inode->i_nlink != 1) 902 if (inode->i_nlink != 2 && inode->i_nlink != 1)
906 reiserfs_warning(inode->i_sb, "%s: empty directory has nlink " 903 reiserfs_warning(inode->i_sb, "reiserfs-7040",
907 "!= 2 (%d)", __func__, inode->i_nlink); 904 "empty directory has nlink != 2 (%d)",
905 inode->i_nlink);
908 906
909 clear_nlink(inode); 907 clear_nlink(inode);
910 inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME_SEC; 908 inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME_SEC;
@@ -980,10 +978,9 @@ static int reiserfs_unlink(struct inode *dir, struct dentry *dentry)
980 } 978 }
981 979
982 if (!inode->i_nlink) { 980 if (!inode->i_nlink) {
983 reiserfs_warning(inode->i_sb, "%s: deleting nonexistent file " 981 reiserfs_warning(inode->i_sb, "reiserfs-7042",
984 "(%s:%lu), %d", __func__, 982 "deleting nonexistent file (%lu), %d",
985 reiserfs_bdevname(inode->i_sb), inode->i_ino, 983 inode->i_ino, inode->i_nlink);
986 inode->i_nlink);
987 inode->i_nlink = 1; 984 inode->i_nlink = 1;
988 } 985 }
989 986
@@ -1499,8 +1496,8 @@ static int reiserfs_rename(struct inode *old_dir, struct dentry *old_dentry,
1499 if (reiserfs_cut_from_item 1496 if (reiserfs_cut_from_item
1500 (&th, &old_entry_path, &(old_de.de_entry_key), old_dir, NULL, 1497 (&th, &old_entry_path, &(old_de.de_entry_key), old_dir, NULL,
1501 0) < 0) 1498 0) < 0)
1502 reiserfs_warning(old_dir->i_sb, 1499 reiserfs_warning(old_dir->i_sb, "vs-7060",
1503 "vs-7060: reiserfs_rename: couldn't not cut old name. Fsck later?"); 1500 "couldn't not cut old name. Fsck later?");
1504 1501
1505 old_dir->i_size -= DEH_SIZE + old_de.de_entrylen; 1502 old_dir->i_size -= DEH_SIZE + old_de.de_entrylen;
1506 1503
diff --git a/fs/reiserfs/objectid.c b/fs/reiserfs/objectid.c
index ea0cf8c28a99..a3a5f43ff443 100644
--- a/fs/reiserfs/objectid.c
+++ b/fs/reiserfs/objectid.c
@@ -61,7 +61,7 @@ __u32 reiserfs_get_unused_objectid(struct reiserfs_transaction_handle *th)
61 /* comment needed -Hans */ 61 /* comment needed -Hans */
62 unused_objectid = le32_to_cpu(map[1]); 62 unused_objectid = le32_to_cpu(map[1]);
63 if (unused_objectid == U32_MAX) { 63 if (unused_objectid == U32_MAX) {
64 reiserfs_warning(s, "%s: no more object ids", __func__); 64 reiserfs_warning(s, "reiserfs-15100", "no more object ids");
65 reiserfs_restore_prepared_buffer(s, SB_BUFFER_WITH_SB(s)); 65 reiserfs_restore_prepared_buffer(s, SB_BUFFER_WITH_SB(s));
66 return 0; 66 return 0;
67 } 67 }
@@ -160,8 +160,7 @@ void reiserfs_release_objectid(struct reiserfs_transaction_handle *th,
160 i += 2; 160 i += 2;
161 } 161 }
162 162
163 reiserfs_warning(s, 163 reiserfs_warning(s, "vs-15011", "tried to free free object id (%lu)",
164 "vs-15011: reiserfs_release_objectid: tried to free free object id (%lu)",
165 (long unsigned)objectid_to_release); 164 (long unsigned)objectid_to_release);
166} 165}
167 166
diff --git a/fs/reiserfs/prints.c b/fs/reiserfs/prints.c
index 535a3c7fc68e..50ed4bd3ef63 100644
--- a/fs/reiserfs/prints.c
+++ b/fs/reiserfs/prints.c
@@ -264,14 +264,17 @@ static void prepare_error_buf(const char *fmt, va_list args)
264 va_end( args );\ 264 va_end( args );\
265} 265}
266 266
267void reiserfs_warning(struct super_block *sb, const char *fmt, ...) 267void __reiserfs_warning(struct super_block *sb, const char *id,
268 const char *function, const char *fmt, ...)
268{ 269{
269 do_reiserfs_warning(fmt); 270 do_reiserfs_warning(fmt);
270 if (sb) 271 if (sb)
271 printk(KERN_WARNING "REISERFS warning (device %s): %s\n", 272 printk(KERN_WARNING "REISERFS warning (device %s): %s%s%s: "
272 sb->s_id, error_buf); 273 "%s\n", sb->s_id, id ? id : "", id ? " " : "",
274 function, error_buf);
273 else 275 else
274 printk(KERN_WARNING "REISERFS warning: %s\n", error_buf); 276 printk(KERN_WARNING "REISERFS warning: %s%s%s: %s\n",
277 id ? id : "", id ? " " : "", function, error_buf);
275} 278}
276 279
277/* No newline.. reiserfs_info calls can be followed by printk's */ 280/* No newline.. reiserfs_info calls can be followed by printk's */
diff --git a/fs/reiserfs/procfs.c b/fs/reiserfs/procfs.c
index 370988efc8ad..d4d7f1433ed0 100644
--- a/fs/reiserfs/procfs.c
+++ b/fs/reiserfs/procfs.c
@@ -503,7 +503,7 @@ int reiserfs_proc_info_init(struct super_block *sb)
503 add_file(sb, "journal", show_journal); 503 add_file(sb, "journal", show_journal);
504 return 0; 504 return 0;
505 } 505 }
506 reiserfs_warning(sb, "reiserfs: cannot create /proc/%s/%s", 506 reiserfs_warning(sb, "cannot create /proc/%s/%s",
507 proc_info_root_name, b); 507 proc_info_root_name, b);
508 return 1; 508 return 1;
509} 509}
@@ -559,8 +559,7 @@ int reiserfs_proc_info_global_init(void)
559 if (proc_info_root) { 559 if (proc_info_root) {
560 proc_info_root->owner = THIS_MODULE; 560 proc_info_root->owner = THIS_MODULE;
561 } else { 561 } else {
562 reiserfs_warning(NULL, 562 reiserfs_warning(NULL, "cannot create /proc/%s",
563 "reiserfs: cannot create /proc/%s",
564 proc_info_root_name); 563 proc_info_root_name);
565 return 1; 564 return 1;
566 } 565 }
diff --git a/fs/reiserfs/stree.c b/fs/reiserfs/stree.c
index abbc64dcc8d4..f328d27a19d5 100644
--- a/fs/reiserfs/stree.c
+++ b/fs/reiserfs/stree.c
@@ -444,23 +444,24 @@ static int is_leaf(char *buf, int blocksize, struct buffer_head *bh)
444 444
445 blkh = (struct block_head *)buf; 445 blkh = (struct block_head *)buf;
446 if (blkh_level(blkh) != DISK_LEAF_NODE_LEVEL) { 446 if (blkh_level(blkh) != DISK_LEAF_NODE_LEVEL) {
447 reiserfs_warning(NULL, 447 reiserfs_warning(NULL, "reiserfs-5080",
448 "is_leaf: this should be caught earlier"); 448 "this should be caught earlier");
449 return 0; 449 return 0;
450 } 450 }
451 451
452 nr = blkh_nr_item(blkh); 452 nr = blkh_nr_item(blkh);
453 if (nr < 1 || nr > ((blocksize - BLKH_SIZE) / (IH_SIZE + MIN_ITEM_LEN))) { 453 if (nr < 1 || nr > ((blocksize - BLKH_SIZE) / (IH_SIZE + MIN_ITEM_LEN))) {
454 /* item number is too big or too small */ 454 /* item number is too big or too small */
455 reiserfs_warning(NULL, "is_leaf: nr_item seems wrong: %z", bh); 455 reiserfs_warning(NULL, "reiserfs-5081",
456 "nr_item seems wrong: %z", bh);
456 return 0; 457 return 0;
457 } 458 }
458 ih = (struct item_head *)(buf + BLKH_SIZE) + nr - 1; 459 ih = (struct item_head *)(buf + BLKH_SIZE) + nr - 1;
459 used_space = BLKH_SIZE + IH_SIZE * nr + (blocksize - ih_location(ih)); 460 used_space = BLKH_SIZE + IH_SIZE * nr + (blocksize - ih_location(ih));
460 if (used_space != blocksize - blkh_free_space(blkh)) { 461 if (used_space != blocksize - blkh_free_space(blkh)) {
461 /* free space does not match to calculated amount of use space */ 462 /* free space does not match to calculated amount of use space */
462 reiserfs_warning(NULL, "is_leaf: free space seems wrong: %z", 463 reiserfs_warning(NULL, "reiserfs-5082",
463 bh); 464 "free space seems wrong: %z", bh);
464 return 0; 465 return 0;
465 } 466 }
466 // FIXME: it is_leaf will hit performance too much - we may have 467 // FIXME: it is_leaf will hit performance too much - we may have
@@ -471,29 +472,29 @@ static int is_leaf(char *buf, int blocksize, struct buffer_head *bh)
471 prev_location = blocksize; 472 prev_location = blocksize;
472 for (i = 0; i < nr; i++, ih++) { 473 for (i = 0; i < nr; i++, ih++) {
473 if (le_ih_k_type(ih) == TYPE_ANY) { 474 if (le_ih_k_type(ih) == TYPE_ANY) {
474 reiserfs_warning(NULL, 475 reiserfs_warning(NULL, "reiserfs-5083",
475 "is_leaf: wrong item type for item %h", 476 "wrong item type for item %h",
476 ih); 477 ih);
477 return 0; 478 return 0;
478 } 479 }
479 if (ih_location(ih) >= blocksize 480 if (ih_location(ih) >= blocksize
480 || ih_location(ih) < IH_SIZE * nr) { 481 || ih_location(ih) < IH_SIZE * nr) {
481 reiserfs_warning(NULL, 482 reiserfs_warning(NULL, "reiserfs-5084",
482 "is_leaf: item location seems wrong: %h", 483 "item location seems wrong: %h",
483 ih); 484 ih);
484 return 0; 485 return 0;
485 } 486 }
486 if (ih_item_len(ih) < 1 487 if (ih_item_len(ih) < 1
487 || ih_item_len(ih) > MAX_ITEM_LEN(blocksize)) { 488 || ih_item_len(ih) > MAX_ITEM_LEN(blocksize)) {
488 reiserfs_warning(NULL, 489 reiserfs_warning(NULL, "reiserfs-5085",
489 "is_leaf: item length seems wrong: %h", 490 "item length seems wrong: %h",
490 ih); 491 ih);
491 return 0; 492 return 0;
492 } 493 }
493 if (prev_location - ih_location(ih) != ih_item_len(ih)) { 494 if (prev_location - ih_location(ih) != ih_item_len(ih)) {
494 reiserfs_warning(NULL, 495 reiserfs_warning(NULL, "reiserfs-5086",
495 "is_leaf: item location seems wrong (second one): %h", 496 "item location seems wrong "
496 ih); 497 "(second one): %h", ih);
497 return 0; 498 return 0;
498 } 499 }
499 prev_location = ih_location(ih); 500 prev_location = ih_location(ih);
@@ -514,24 +515,23 @@ static int is_internal(char *buf, int blocksize, struct buffer_head *bh)
514 nr = blkh_level(blkh); 515 nr = blkh_level(blkh);
515 if (nr <= DISK_LEAF_NODE_LEVEL || nr > MAX_HEIGHT) { 516 if (nr <= DISK_LEAF_NODE_LEVEL || nr > MAX_HEIGHT) {
516 /* this level is not possible for internal nodes */ 517 /* this level is not possible for internal nodes */
517 reiserfs_warning(NULL, 518 reiserfs_warning(NULL, "reiserfs-5087",
518 "is_internal: this should be caught earlier"); 519 "this should be caught earlier");
519 return 0; 520 return 0;
520 } 521 }
521 522
522 nr = blkh_nr_item(blkh); 523 nr = blkh_nr_item(blkh);
523 if (nr > (blocksize - BLKH_SIZE - DC_SIZE) / (KEY_SIZE + DC_SIZE)) { 524 if (nr > (blocksize - BLKH_SIZE - DC_SIZE) / (KEY_SIZE + DC_SIZE)) {
524 /* for internal which is not root we might check min number of keys */ 525 /* for internal which is not root we might check min number of keys */
525 reiserfs_warning(NULL, 526 reiserfs_warning(NULL, "reiserfs-5088",
526 "is_internal: number of key seems wrong: %z", 527 "number of key seems wrong: %z", bh);
527 bh);
528 return 0; 528 return 0;
529 } 529 }
530 530
531 used_space = BLKH_SIZE + KEY_SIZE * nr + DC_SIZE * (nr + 1); 531 used_space = BLKH_SIZE + KEY_SIZE * nr + DC_SIZE * (nr + 1);
532 if (used_space != blocksize - blkh_free_space(blkh)) { 532 if (used_space != blocksize - blkh_free_space(blkh)) {
533 reiserfs_warning(NULL, 533 reiserfs_warning(NULL, "reiserfs-5089",
534 "is_internal: free space seems wrong: %z", bh); 534 "free space seems wrong: %z", bh);
535 return 0; 535 return 0;
536 } 536 }
537 // one may imagine much more checks 537 // one may imagine much more checks
@@ -543,8 +543,8 @@ static int is_internal(char *buf, int blocksize, struct buffer_head *bh)
543static int is_tree_node(struct buffer_head *bh, int level) 543static int is_tree_node(struct buffer_head *bh, int level)
544{ 544{
545 if (B_LEVEL(bh) != level) { 545 if (B_LEVEL(bh) != level) {
546 reiserfs_warning(NULL, 546 reiserfs_warning(NULL, "reiserfs-5090", "node level %d does "
547 "is_tree_node: node level %d does not match to the expected one %d", 547 "not match to the expected one %d",
548 B_LEVEL(bh), level); 548 B_LEVEL(bh), level);
549 return 0; 549 return 0;
550 } 550 }
@@ -645,9 +645,9 @@ int search_by_key(struct super_block *p_s_sb, const struct cpu_key *p_s_key, /*
645 645
646#ifdef CONFIG_REISERFS_CHECK 646#ifdef CONFIG_REISERFS_CHECK
647 if (!(++n_repeat_counter % 50000)) 647 if (!(++n_repeat_counter % 50000))
648 reiserfs_warning(p_s_sb, "PAP-5100: search_by_key: %s:" 648 reiserfs_warning(p_s_sb, "PAP-5100",
649 "there were %d iterations of while loop " 649 "%s: there were %d iterations of "
650 "looking for key %K", 650 "while loop looking for key %K",
651 current->comm, n_repeat_counter, 651 current->comm, n_repeat_counter,
652 p_s_key); 652 p_s_key);
653#endif 653#endif
@@ -721,9 +721,9 @@ int search_by_key(struct super_block *p_s_sb, const struct cpu_key *p_s_key, /*
721 // make sure, that the node contents look like a node of 721 // make sure, that the node contents look like a node of
722 // certain level 722 // certain level
723 if (!is_tree_node(p_s_bh, expected_level)) { 723 if (!is_tree_node(p_s_bh, expected_level)) {
724 reiserfs_warning(p_s_sb, "vs-5150: search_by_key: " 724 reiserfs_warning(p_s_sb, "vs-5150",
725 "invalid format found in block %ld. Fsck?", 725 "invalid format found in block %ld. "
726 p_s_bh->b_blocknr); 726 "Fsck?", p_s_bh->b_blocknr);
727 pathrelse(p_s_search_path); 727 pathrelse(p_s_search_path);
728 return IO_ERROR; 728 return IO_ERROR;
729 } 729 }
@@ -1227,8 +1227,7 @@ int reiserfs_delete_item(struct reiserfs_transaction_handle *th, struct treepath
1227 if (n_ret_value == IO_ERROR) 1227 if (n_ret_value == IO_ERROR)
1228 break; 1228 break;
1229 if (n_ret_value == FILE_NOT_FOUND) { 1229 if (n_ret_value == FILE_NOT_FOUND) {
1230 reiserfs_warning(p_s_sb, 1230 reiserfs_warning(p_s_sb, "vs-5340",
1231 "vs-5340: reiserfs_delete_item: "
1232 "no items of the file %K found", 1231 "no items of the file %K found",
1233 p_s_item_key); 1232 p_s_item_key);
1234 break; 1233 break;
@@ -1338,10 +1337,9 @@ void reiserfs_delete_solid_item(struct reiserfs_transaction_handle *th,
1338 while (1) { 1337 while (1) {
1339 retval = search_item(th->t_super, &cpu_key, &path); 1338 retval = search_item(th->t_super, &cpu_key, &path);
1340 if (retval == IO_ERROR) { 1339 if (retval == IO_ERROR) {
1341 reiserfs_warning(th->t_super, 1340 reiserfs_warning(th->t_super, "vs-5350",
1342 "vs-5350: reiserfs_delete_solid_item: " 1341 "i/o failure occurred trying "
1343 "i/o failure occurred trying to delete %K", 1342 "to delete %K", &cpu_key);
1344 &cpu_key);
1345 break; 1343 break;
1346 } 1344 }
1347 if (retval != ITEM_FOUND) { 1345 if (retval != ITEM_FOUND) {
@@ -1355,9 +1353,8 @@ void reiserfs_delete_solid_item(struct reiserfs_transaction_handle *th,
1355 GET_GENERATION_NUMBER(le_key_k_offset 1353 GET_GENERATION_NUMBER(le_key_k_offset
1356 (le_key_version(key), 1354 (le_key_version(key),
1357 key)) == 1)) 1355 key)) == 1))
1358 reiserfs_warning(th->t_super, 1356 reiserfs_warning(th->t_super, "vs-5355",
1359 "vs-5355: reiserfs_delete_solid_item: %k not found", 1357 "%k not found", key);
1360 key);
1361 break; 1358 break;
1362 } 1359 }
1363 if (!tb_init) { 1360 if (!tb_init) {
@@ -1389,8 +1386,7 @@ void reiserfs_delete_solid_item(struct reiserfs_transaction_handle *th,
1389 break; 1386 break;
1390 } 1387 }
1391 // IO_ERROR, NO_DISK_SPACE, etc 1388 // IO_ERROR, NO_DISK_SPACE, etc
1392 reiserfs_warning(th->t_super, 1389 reiserfs_warning(th->t_super, "vs-5360",
1393 "vs-5360: reiserfs_delete_solid_item: "
1394 "could not delete %K due to fix_nodes failure", 1390 "could not delete %K due to fix_nodes failure",
1395 &cpu_key); 1391 &cpu_key);
1396 unfix_nodes(&tb); 1392 unfix_nodes(&tb);
@@ -1533,8 +1529,9 @@ static void indirect_to_direct_roll_back(struct reiserfs_transaction_handle *th,
1533 set_cpu_key_k_offset(&tail_key, 1529 set_cpu_key_k_offset(&tail_key,
1534 cpu_key_k_offset(&tail_key) - removed); 1530 cpu_key_k_offset(&tail_key) - removed);
1535 } 1531 }
1536 reiserfs_warning(inode->i_sb, 1532 reiserfs_warning(inode->i_sb, "reiserfs-5091", "indirect_to_direct "
1537 "indirect_to_direct_roll_back: indirect_to_direct conversion has been rolled back due to lack of disk space"); 1533 "conversion has been rolled back due to "
1534 "lack of disk space");
1538 //mark_file_without_tail (inode); 1535 //mark_file_without_tail (inode);
1539 mark_inode_dirty(inode); 1536 mark_inode_dirty(inode);
1540} 1537}
@@ -1639,8 +1636,7 @@ int reiserfs_cut_from_item(struct reiserfs_transaction_handle *th,
1639 if (n_ret_value == POSITION_FOUND) 1636 if (n_ret_value == POSITION_FOUND)
1640 continue; 1637 continue;
1641 1638
1642 reiserfs_warning(p_s_sb, 1639 reiserfs_warning(p_s_sb, "PAP-5610", "item %K not found",
1643 "PAP-5610: reiserfs_cut_from_item: item %K not found",
1644 p_s_item_key); 1640 p_s_item_key);
1645 unfix_nodes(&s_cut_balance); 1641 unfix_nodes(&s_cut_balance);
1646 return (n_ret_value == IO_ERROR) ? -EIO : -ENOENT; 1642 return (n_ret_value == IO_ERROR) ? -EIO : -ENOENT;
@@ -1654,7 +1650,8 @@ int reiserfs_cut_from_item(struct reiserfs_transaction_handle *th,
1654 indirect_to_direct_roll_back(th, p_s_inode, p_s_path); 1650 indirect_to_direct_roll_back(th, p_s_inode, p_s_path);
1655 } 1651 }
1656 if (n_ret_value == NO_DISK_SPACE) 1652 if (n_ret_value == NO_DISK_SPACE)
1657 reiserfs_warning(p_s_sb, "NO_DISK_SPACE"); 1653 reiserfs_warning(p_s_sb, "reiserfs-5092",
1654 "NO_DISK_SPACE");
1658 unfix_nodes(&s_cut_balance); 1655 unfix_nodes(&s_cut_balance);
1659 return -EIO; 1656 return -EIO;
1660 } 1657 }
@@ -1743,8 +1740,7 @@ static void truncate_directory(struct reiserfs_transaction_handle *th,
1743{ 1740{
1744 BUG_ON(!th->t_trans_id); 1741 BUG_ON(!th->t_trans_id);
1745 if (inode->i_nlink) 1742 if (inode->i_nlink)
1746 reiserfs_warning(inode->i_sb, 1743 reiserfs_warning(inode->i_sb, "vs-5655", "link count != 0");
1747 "vs-5655: truncate_directory: link count != 0");
1748 1744
1749 set_le_key_k_offset(KEY_FORMAT_3_5, INODE_PKEY(inode), DOT_OFFSET); 1745 set_le_key_k_offset(KEY_FORMAT_3_5, INODE_PKEY(inode), DOT_OFFSET);
1750 set_le_key_k_type(KEY_FORMAT_3_5, INODE_PKEY(inode), TYPE_DIRENTRY); 1746 set_le_key_k_type(KEY_FORMAT_3_5, INODE_PKEY(inode), TYPE_DIRENTRY);
@@ -1797,16 +1793,14 @@ int reiserfs_do_truncate(struct reiserfs_transaction_handle *th, struct inode *p
1797 search_for_position_by_key(p_s_inode->i_sb, &s_item_key, 1793 search_for_position_by_key(p_s_inode->i_sb, &s_item_key,
1798 &s_search_path); 1794 &s_search_path);
1799 if (retval == IO_ERROR) { 1795 if (retval == IO_ERROR) {
1800 reiserfs_warning(p_s_inode->i_sb, 1796 reiserfs_warning(p_s_inode->i_sb, "vs-5657",
1801 "vs-5657: reiserfs_do_truncate: "
1802 "i/o failure occurred trying to truncate %K", 1797 "i/o failure occurred trying to truncate %K",
1803 &s_item_key); 1798 &s_item_key);
1804 err = -EIO; 1799 err = -EIO;
1805 goto out; 1800 goto out;
1806 } 1801 }
1807 if (retval == POSITION_FOUND || retval == FILE_NOT_FOUND) { 1802 if (retval == POSITION_FOUND || retval == FILE_NOT_FOUND) {
1808 reiserfs_warning(p_s_inode->i_sb, 1803 reiserfs_warning(p_s_inode->i_sb, "PAP-5660",
1809 "PAP-5660: reiserfs_do_truncate: "
1810 "wrong result %d of search for %K", retval, 1804 "wrong result %d of search for %K", retval,
1811 &s_item_key); 1805 &s_item_key);
1812 1806
@@ -1850,8 +1844,8 @@ int reiserfs_do_truncate(struct reiserfs_transaction_handle *th, struct inode *p
1850 reiserfs_cut_from_item(th, &s_search_path, &s_item_key, 1844 reiserfs_cut_from_item(th, &s_search_path, &s_item_key,
1851 p_s_inode, page, n_new_file_size); 1845 p_s_inode, page, n_new_file_size);
1852 if (n_deleted < 0) { 1846 if (n_deleted < 0) {
1853 reiserfs_warning(p_s_inode->i_sb, 1847 reiserfs_warning(p_s_inode->i_sb, "vs-5665",
1854 "vs-5665: reiserfs_do_truncate: reiserfs_cut_from_item failed"); 1848 "reiserfs_cut_from_item failed");
1855 reiserfs_check_path(&s_search_path); 1849 reiserfs_check_path(&s_search_path);
1856 return 0; 1850 return 0;
1857 } 1851 }
@@ -2000,8 +1994,8 @@ int reiserfs_paste_into_item(struct reiserfs_transaction_handle *th, struct tree
2000 goto error_out; 1994 goto error_out;
2001 } 1995 }
2002 if (retval == POSITION_FOUND) { 1996 if (retval == POSITION_FOUND) {
2003 reiserfs_warning(inode->i_sb, 1997 reiserfs_warning(inode->i_sb, "PAP-5710",
2004 "PAP-5710: reiserfs_paste_into_item: entry or pasted byte (%K) exists", 1998 "entry or pasted byte (%K) exists",
2005 p_s_key); 1999 p_s_key);
2006 retval = -EEXIST; 2000 retval = -EEXIST;
2007 goto error_out; 2001 goto error_out;
@@ -2087,8 +2081,7 @@ int reiserfs_insert_item(struct reiserfs_transaction_handle *th, struct treepath
2087 goto error_out; 2081 goto error_out;
2088 } 2082 }
2089 if (retval == ITEM_FOUND) { 2083 if (retval == ITEM_FOUND) {
2090 reiserfs_warning(th->t_super, 2084 reiserfs_warning(th->t_super, "PAP-5760",
2091 "PAP-5760: reiserfs_insert_item: "
2092 "key %K already exists in the tree", 2085 "key %K already exists in the tree",
2093 key); 2086 key);
2094 retval = -EEXIST; 2087 retval = -EEXIST;
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
1596static int reiserfs_fill_super(struct super_block *s, void *data, int silent) 1618static 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
diff --git a/fs/reiserfs/tail_conversion.c b/fs/reiserfs/tail_conversion.c
index f8121a1147e8..256285dddb20 100644
--- a/fs/reiserfs/tail_conversion.c
+++ b/fs/reiserfs/tail_conversion.c
@@ -48,9 +48,9 @@ int direct2indirect(struct reiserfs_transaction_handle *th, struct inode *inode,
48 48
49 // FIXME: we could avoid this 49 // FIXME: we could avoid this
50 if (search_for_position_by_key(sb, &end_key, path) == POSITION_FOUND) { 50 if (search_for_position_by_key(sb, &end_key, path) == POSITION_FOUND) {
51 reiserfs_warning(sb, "PAP-14030: direct2indirect: " 51 reiserfs_warning(sb, "PAP-14030",
52 "pasted or inserted byte exists in the tree %K. " 52 "pasted or inserted byte exists in "
53 "Use fsck to repair.", &end_key); 53 "the tree %K. Use fsck to repair.", &end_key);
54 pathrelse(path); 54 pathrelse(path);
55 return -EIO; 55 return -EIO;
56 } 56 }
diff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c
index e11b00472361..d14f5c2c0e4a 100644
--- a/fs/reiserfs/xattr.c
+++ b/fs/reiserfs/xattr.c
@@ -259,7 +259,8 @@ static int __xattr_readdir(struct inode *inode, void *dirent, filldir_t filldir)
259 ih = de.de_ih; 259 ih = de.de_ih;
260 260
261 if (!is_direntry_le_ih(ih)) { 261 if (!is_direntry_le_ih(ih)) {
262 reiserfs_warning(inode->i_sb, "not direntry %h", ih); 262 reiserfs_warning(inode->i_sb, "jdm-20000",
263 "not direntry %h", ih);
263 break; 264 break;
264 } 265 }
265 copy_item_head(&tmp_ih, ih); 266 copy_item_head(&tmp_ih, ih);
@@ -598,7 +599,7 @@ reiserfs_xattr_get(const struct inode *inode, const char *name, void *buffer,
598 if (rxh->h_magic != cpu_to_le32(REISERFS_XATTR_MAGIC)) { 599 if (rxh->h_magic != cpu_to_le32(REISERFS_XATTR_MAGIC)) {
599 unlock_page(page); 600 unlock_page(page);
600 reiserfs_put_page(page); 601 reiserfs_put_page(page);
601 reiserfs_warning(inode->i_sb, 602 reiserfs_warning(inode->i_sb, "jdm-20001",
602 "Invalid magic for xattr (%s) " 603 "Invalid magic for xattr (%s) "
603 "associated with %k", name, 604 "associated with %k", name,
604 INODE_PKEY(inode)); 605 INODE_PKEY(inode));
@@ -618,7 +619,7 @@ reiserfs_xattr_get(const struct inode *inode, const char *name, void *buffer,
618 619
619 if (xattr_hash(buffer, isize - sizeof(struct reiserfs_xattr_header)) != 620 if (xattr_hash(buffer, isize - sizeof(struct reiserfs_xattr_header)) !=
620 hash) { 621 hash) {
621 reiserfs_warning(inode->i_sb, 622 reiserfs_warning(inode->i_sb, "jdm-20002",
622 "Invalid hash for xattr (%s) associated " 623 "Invalid hash for xattr (%s) associated "
623 "with %k", name, INODE_PKEY(inode)); 624 "with %k", name, INODE_PKEY(inode));
624 err = -EIO; 625 err = -EIO;
@@ -652,7 +653,8 @@ __reiserfs_xattr_del(struct dentry *xadir, const char *name, int namelen)
652 goto out_file; 653 goto out_file;
653 654
654 if (!is_reiserfs_priv_object(dentry->d_inode)) { 655 if (!is_reiserfs_priv_object(dentry->d_inode)) {
655 reiserfs_warning(dir->i_sb, "OID %08x [%.*s/%.*s] doesn't have " 656 reiserfs_warning(dir->i_sb, "jdm-20003",
657 "OID %08x [%.*s/%.*s] doesn't have "
656 "priv flag set [parent is %sset].", 658 "priv flag set [parent is %sset].",
657 le32_to_cpu(INODE_PKEY(dentry->d_inode)-> 659 le32_to_cpu(INODE_PKEY(dentry->d_inode)->
658 k_objectid), xadir->d_name.len, 660 k_objectid), xadir->d_name.len,
@@ -750,7 +752,7 @@ int reiserfs_delete_xattrs(struct inode *inode)
750 reiserfs_write_unlock_xattrs(inode->i_sb); 752 reiserfs_write_unlock_xattrs(inode->i_sb);
751 dput(root); 753 dput(root);
752 } else { 754 } else {
753 reiserfs_warning(inode->i_sb, 755 reiserfs_warning(inode->i_sb, "jdm-20006",
754 "Couldn't remove all entries in directory"); 756 "Couldn't remove all entries in directory");
755 } 757 }
756 unlock_kernel(); 758 unlock_kernel();
@@ -1154,7 +1156,8 @@ int reiserfs_xattr_init(struct super_block *s, int mount_flags)
1154 } else if (reiserfs_xattrs_optional(s)) { 1156 } else if (reiserfs_xattrs_optional(s)) {
1155 /* Old format filesystem, but optional xattrs have been enabled 1157 /* Old format filesystem, but optional xattrs have been enabled
1156 * at mount time. Error out. */ 1158 * at mount time. Error out. */
1157 reiserfs_warning(s, "xattrs/ACLs not supported on pre v3.6 " 1159 reiserfs_warning(s, "jdm-20005",
1160 "xattrs/ACLs not supported on pre v3.6 "
1158 "format filesystem. Failing mount."); 1161 "format filesystem. Failing mount.");
1159 err = -EOPNOTSUPP; 1162 err = -EOPNOTSUPP;
1160 goto error; 1163 goto error;
@@ -1201,8 +1204,10 @@ int reiserfs_xattr_init(struct super_block *s, int mount_flags)
1201 /* If we're read-only it just means that the dir hasn't been 1204 /* If we're read-only it just means that the dir hasn't been
1202 * created. Not an error -- just no xattrs on the fs. We'll 1205 * created. Not an error -- just no xattrs on the fs. We'll
1203 * check again if we go read-write */ 1206 * check again if we go read-write */
1204 reiserfs_warning(s, "xattrs/ACLs enabled and couldn't " 1207 reiserfs_warning(s, "jdm-20006",
1205 "find/create .reiserfs_priv. Failing mount."); 1208 "xattrs/ACLs enabled and couldn't "
1209 "find/create .reiserfs_priv. "
1210 "Failing mount.");
1206 err = -EOPNOTSUPP; 1211 err = -EOPNOTSUPP;
1207 } 1212 }
1208 } 1213 }