提交 45b03d5e 编写于 作者: J Jeff Mahoney 提交者: Linus Torvalds

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: NJeff Mahoney <jeffm@suse.com>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 1d889d99
...@@ -64,8 +64,8 @@ int is_reusable(struct super_block *s, b_blocknr_t block, int bit_value) ...@@ -64,8 +64,8 @@ int is_reusable(struct super_block *s, b_blocknr_t block, int bit_value)
unsigned int bmap_count = reiserfs_bmap_count(s); unsigned int bmap_count = reiserfs_bmap_count(s);
if (block == 0 || block >= SB_BLOCK_COUNT(s)) { if (block == 0 || block >= SB_BLOCK_COUNT(s)) {
reiserfs_warning(s, reiserfs_warning(s, "vs-4010",
"vs-4010: is_reusable: block number is out of range %lu (%u)", "block number is out of range %lu (%u)",
block, SB_BLOCK_COUNT(s)); block, SB_BLOCK_COUNT(s));
return 0; return 0;
} }
...@@ -79,30 +79,29 @@ int is_reusable(struct super_block *s, b_blocknr_t block, int bit_value) ...@@ -79,30 +79,29 @@ int is_reusable(struct super_block *s, b_blocknr_t block, int bit_value)
b_blocknr_t bmap1 = REISERFS_SB(s)->s_sbh->b_blocknr + 1; b_blocknr_t bmap1 = REISERFS_SB(s)->s_sbh->b_blocknr + 1;
if (block >= bmap1 && if (block >= bmap1 &&
block <= bmap1 + bmap_count) { block <= bmap1 + bmap_count) {
reiserfs_warning(s, "vs: 4019: is_reusable: " reiserfs_warning(s, "vs-4019", "bitmap block %lu(%u) "
"bitmap block %lu(%u) can't be freed or reused", "can't be freed or reused",
block, bmap_count); block, bmap_count);
return 0; return 0;
} }
} else { } else {
if (offset == 0) { if (offset == 0) {
reiserfs_warning(s, "vs: 4020: is_reusable: " reiserfs_warning(s, "vs-4020", "bitmap block %lu(%u) "
"bitmap block %lu(%u) can't be freed or reused", "can't be freed or reused",
block, bmap_count); block, bmap_count);
return 0; return 0;
} }
} }
if (bmap >= bmap_count) { if (bmap >= bmap_count) {
reiserfs_warning(s, reiserfs_warning(s, "vs-4030", "bitmap for requested block "
"vs-4030: is_reusable: there is no so many bitmap blocks: " "is out of range: block=%lu, bitmap_nr=%u",
"block=%lu, bitmap_nr=%u", block, bmap); block, bmap);
return 0; return 0;
} }
if (bit_value == 0 && block == SB_ROOT_BLOCK(s)) { if (bit_value == 0 && block == SB_ROOT_BLOCK(s)) {
reiserfs_warning(s, reiserfs_warning(s, "vs-4050", "this is root block (%u), "
"vs-4050: is_reusable: this is root block (%u), "
"it must be busy", SB_ROOT_BLOCK(s)); "it must be busy", SB_ROOT_BLOCK(s));
return 0; return 0;
} }
...@@ -154,8 +153,8 @@ static int scan_bitmap_block(struct reiserfs_transaction_handle *th, ...@@ -154,8 +153,8 @@ static int scan_bitmap_block(struct reiserfs_transaction_handle *th,
/* - I mean `a window of zero bits' as in description of this function - Zam. */ /* - I mean `a window of zero bits' as in description of this function - Zam. */
if (!bi) { if (!bi) {
reiserfs_warning(s, "NULL bitmap info pointer for bitmap %d", reiserfs_warning(s, "jdm-4055", "NULL bitmap info pointer "
bmap_n); "for bitmap %d", bmap_n);
return 0; return 0;
} }
...@@ -400,11 +399,8 @@ static void _reiserfs_free_block(struct reiserfs_transaction_handle *th, ...@@ -400,11 +399,8 @@ static void _reiserfs_free_block(struct reiserfs_transaction_handle *th,
get_bit_address(s, block, &nr, &offset); get_bit_address(s, block, &nr, &offset);
if (nr >= reiserfs_bmap_count(s)) { if (nr >= reiserfs_bmap_count(s)) {
reiserfs_warning(s, "vs-4075: reiserfs_free_block: " reiserfs_warning(s, "vs-4075", "block %lu is out of range",
"block %lu is out of range on %s " block);
"(nr=%u,max=%u)", block,
reiserfs_bdevname(s), nr,
reiserfs_bmap_count(s));
return; return;
} }
...@@ -416,9 +412,8 @@ static void _reiserfs_free_block(struct reiserfs_transaction_handle *th, ...@@ -416,9 +412,8 @@ static void _reiserfs_free_block(struct reiserfs_transaction_handle *th,
/* clear bit for the given block in bit map */ /* clear bit for the given block in bit map */
if (!reiserfs_test_and_clear_le_bit(offset, bmbh->b_data)) { if (!reiserfs_test_and_clear_le_bit(offset, bmbh->b_data)) {
reiserfs_warning(s, "vs-4080: reiserfs_free_block: " reiserfs_warning(s, "vs-4080",
"free_block (%s:%lu)[dev:blocknr]: bit already cleared", "block %lu: bit already cleared", block);
reiserfs_bdevname(s), block);
} }
apbi[nr].free_count++; apbi[nr].free_count++;
journal_mark_dirty(th, s, bmbh); journal_mark_dirty(th, s, bmbh);
...@@ -477,9 +472,8 @@ static void __discard_prealloc(struct reiserfs_transaction_handle *th, ...@@ -477,9 +472,8 @@ static void __discard_prealloc(struct reiserfs_transaction_handle *th,
BUG_ON(!th->t_trans_id); BUG_ON(!th->t_trans_id);
#ifdef CONFIG_REISERFS_CHECK #ifdef CONFIG_REISERFS_CHECK
if (ei->i_prealloc_count < 0) if (ei->i_prealloc_count < 0)
reiserfs_warning(th->t_super, reiserfs_warning(th->t_super, "zam-4001",
"zam-4001:%s: inode has negative prealloc blocks count.", "inode has negative prealloc blocks count.");
__func__);
#endif #endif
while (ei->i_prealloc_count > 0) { while (ei->i_prealloc_count > 0) {
reiserfs_free_prealloc_block(th, inode, ei->i_prealloc_block); 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,9 +509,9 @@ void reiserfs_discard_all_prealloc(struct reiserfs_transaction_handle *th)
i_prealloc_list); i_prealloc_list);
#ifdef CONFIG_REISERFS_CHECK #ifdef CONFIG_REISERFS_CHECK
if (!ei->i_prealloc_count) { if (!ei->i_prealloc_count) {
reiserfs_warning(th->t_super, reiserfs_warning(th->t_super, "zam-4001",
"zam-4001:%s: inode is in prealloc list but has no preallocated blocks.", "inode is in prealloc list but has "
__func__); "no preallocated blocks.");
} }
#endif #endif
__discard_prealloc(th, ei); __discard_prealloc(th, ei);
...@@ -631,8 +625,8 @@ int reiserfs_parse_alloc_options(struct super_block *s, char *options) ...@@ -631,8 +625,8 @@ int reiserfs_parse_alloc_options(struct super_block *s, char *options)
continue; continue;
} }
reiserfs_warning(s, "zam-4001: %s : unknown option - %s", reiserfs_warning(s, "zam-4001", "unknown option - %s",
__func__, this_char); this_char);
return 1; return 1;
} }
......
...@@ -1752,15 +1752,16 @@ static void store_thrown(struct tree_balance *tb, struct buffer_head *bh) ...@@ -1752,15 +1752,16 @@ static void store_thrown(struct tree_balance *tb, struct buffer_head *bh)
int i; int i;
if (buffer_dirty(bh)) if (buffer_dirty(bh))
reiserfs_warning(tb->tb_sb, reiserfs_warning(tb->tb_sb, "reiserfs-12320",
"store_thrown deals with dirty buffer"); "called with dirty buffer");
for (i = 0; i < ARRAY_SIZE(tb->thrown); i++) for (i = 0; i < ARRAY_SIZE(tb->thrown); i++)
if (!tb->thrown[i]) { if (!tb->thrown[i]) {
tb->thrown[i] = bh; tb->thrown[i] = bh;
get_bh(bh); /* free_thrown puts this */ get_bh(bh); /* free_thrown puts this */
return; return;
} }
reiserfs_warning(tb->tb_sb, "store_thrown: too many thrown buffers"); reiserfs_warning(tb->tb_sb, "reiserfs-12321",
"too many thrown buffers");
} }
static void free_thrown(struct tree_balance *tb) static void free_thrown(struct tree_balance *tb)
...@@ -1771,8 +1772,8 @@ static void free_thrown(struct tree_balance *tb) ...@@ -1771,8 +1772,8 @@ static void free_thrown(struct tree_balance *tb)
if (tb->thrown[i]) { if (tb->thrown[i]) {
blocknr = tb->thrown[i]->b_blocknr; blocknr = tb->thrown[i]->b_blocknr;
if (buffer_dirty(tb->thrown[i])) if (buffer_dirty(tb->thrown[i]))
reiserfs_warning(tb->tb_sb, reiserfs_warning(tb->tb_sb, "reiserfs-12322",
"free_thrown deals with dirty buffer %d", "called with dirty buffer %d",
blocknr); blocknr);
brelse(tb->thrown[i]); /* incremented in store_thrown */ brelse(tb->thrown[i]); /* incremented in store_thrown */
reiserfs_free_block(tb->transaction_handle, NULL, 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,13 +1878,12 @@ static void check_internal_node(struct super_block *s, struct buffer_head *bh,
} }
} }
static int locked_or_not_in_tree(struct buffer_head *bh, char *which) static int locked_or_not_in_tree(struct tree_balance *tb,
struct buffer_head *bh, char *which)
{ {
if ((!buffer_journal_prepared(bh) && buffer_locked(bh)) || if ((!buffer_journal_prepared(bh) && buffer_locked(bh)) ||
!B_IS_IN_TREE(bh)) { !B_IS_IN_TREE(bh)) {
reiserfs_warning(NULL, reiserfs_warning(tb->tb_sb, "vs-12339", "%s (%b)", which, bh);
"vs-12339: locked_or_not_in_tree: %s (%b)",
which, bh);
return 1; return 1;
} }
return 0; return 0;
...@@ -1902,18 +1902,19 @@ static int check_before_balancing(struct tree_balance *tb) ...@@ -1902,18 +1902,19 @@ static int check_before_balancing(struct tree_balance *tb)
/* double check that buffers that we will modify are unlocked. (fix_nodes should already have /* double check that buffers that we will modify are unlocked. (fix_nodes should already have
prepped all of these for us). */ prepped all of these for us). */
if (tb->lnum[0]) { if (tb->lnum[0]) {
retval |= locked_or_not_in_tree(tb->L[0], "L[0]"); retval |= locked_or_not_in_tree(tb, tb->L[0], "L[0]");
retval |= locked_or_not_in_tree(tb->FL[0], "FL[0]"); retval |= locked_or_not_in_tree(tb, tb->FL[0], "FL[0]");
retval |= locked_or_not_in_tree(tb->CFL[0], "CFL[0]"); retval |= locked_or_not_in_tree(tb, tb->CFL[0], "CFL[0]");
check_leaf(tb->L[0]); check_leaf(tb->L[0]);
} }
if (tb->rnum[0]) { if (tb->rnum[0]) {
retval |= locked_or_not_in_tree(tb->R[0], "R[0]"); retval |= locked_or_not_in_tree(tb, tb->R[0], "R[0]");
retval |= locked_or_not_in_tree(tb->FR[0], "FR[0]"); retval |= locked_or_not_in_tree(tb, tb->FR[0], "FR[0]");
retval |= locked_or_not_in_tree(tb->CFR[0], "CFR[0]"); retval |= locked_or_not_in_tree(tb, tb->CFR[0], "CFR[0]");
check_leaf(tb->R[0]); check_leaf(tb->R[0]);
} }
retval |= locked_or_not_in_tree(PATH_PLAST_BUFFER(tb->tb_path), "S[0]"); retval |= locked_or_not_in_tree(tb, PATH_PLAST_BUFFER(tb->tb_path),
"S[0]");
check_leaf(PATH_PLAST_BUFFER(tb->tb_path)); check_leaf(PATH_PLAST_BUFFER(tb->tb_path));
return retval; return retval;
...@@ -1952,7 +1953,7 @@ static void check_after_balance_leaf(struct tree_balance *tb) ...@@ -1952,7 +1953,7 @@ static void check_after_balance_leaf(struct tree_balance *tb)
PATH_H_POSITION(tb->tb_path, PATH_H_POSITION(tb->tb_path,
1)))); 1))));
print_cur_tb("12223"); print_cur_tb("12223");
reiserfs_warning(tb->tb_sb, reiserfs_warning(tb->tb_sb, "reiserfs-12363",
"B_FREE_SPACE (PATH_H_PBUFFER(tb->tb_path,0)) = %d; " "B_FREE_SPACE (PATH_H_PBUFFER(tb->tb_path,0)) = %d; "
"MAX_CHILD_SIZE (%d) - dc_size( %y, %d ) [%d] = %d", "MAX_CHILD_SIZE (%d) - dc_size( %y, %d ) [%d] = %d",
left, left,
...@@ -2104,9 +2105,8 @@ void do_balance(struct tree_balance *tb, /* tree_balance structure */ ...@@ -2104,9 +2105,8 @@ void do_balance(struct tree_balance *tb, /* tree_balance structure */
} }
/* if we have no real work to do */ /* if we have no real work to do */
if (!tb->insert_size[0]) { if (!tb->insert_size[0]) {
reiserfs_warning(tb->tb_sb, reiserfs_warning(tb->tb_sb, "PAP-12350",
"PAP-12350: do_balance: insert_size == 0, mode == %c", "insert_size == 0, mode == %c", flag);
flag);
unfix_nodes(tb); unfix_nodes(tb);
return; return;
} }
......
...@@ -76,7 +76,7 @@ static int reiserfs_file_release(struct inode *inode, struct file *filp) ...@@ -76,7 +76,7 @@ static int reiserfs_file_release(struct inode *inode, struct file *filp)
* and let the admin know what is going on. * and let the admin know what is going on.
*/ */
igrab(inode); igrab(inode);
reiserfs_warning(inode->i_sb, reiserfs_warning(inode->i_sb, "clm-9001",
"pinning inode %lu because the " "pinning inode %lu because the "
"preallocation can't be freed", "preallocation can't be freed",
inode->i_ino); inode->i_ino);
......
...@@ -496,8 +496,8 @@ static int get_num_ver(int mode, struct tree_balance *tb, int h, ...@@ -496,8 +496,8 @@ static int get_num_ver(int mode, struct tree_balance *tb, int h,
snum012[needed_nodes - 1 + 3] = units; snum012[needed_nodes - 1 + 3] = units;
if (needed_nodes > 2) if (needed_nodes > 2)
reiserfs_warning(tb->tb_sb, "vs-8111: get_num_ver: " reiserfs_warning(tb->tb_sb, "vs-8111",
"split_item_position is out of boundary"); "split_item_position is out of range");
snum012[needed_nodes - 1]++; snum012[needed_nodes - 1]++;
split_item_positions[needed_nodes - 1] = i; split_item_positions[needed_nodes - 1] = i;
needed_nodes++; needed_nodes++;
...@@ -533,8 +533,8 @@ static int get_num_ver(int mode, struct tree_balance *tb, int h, ...@@ -533,8 +533,8 @@ static int get_num_ver(int mode, struct tree_balance *tb, int h,
if (vn->vn_vi[split_item_num].vi_index != TYPE_DIRENTRY && if (vn->vn_vi[split_item_num].vi_index != TYPE_DIRENTRY &&
vn->vn_vi[split_item_num].vi_index != TYPE_INDIRECT) vn->vn_vi[split_item_num].vi_index != TYPE_INDIRECT)
reiserfs_warning(tb->tb_sb, "vs-8115: get_num_ver: not " reiserfs_warning(tb->tb_sb, "vs-8115",
"directory or indirect item"); "not directory or indirect item");
} }
/* now we know S2bytes, calculate S1bytes */ /* now we know S2bytes, calculate S1bytes */
...@@ -2268,9 +2268,9 @@ static int wait_tb_buffers_until_unlocked(struct tree_balance *p_s_tb) ...@@ -2268,9 +2268,9 @@ static int wait_tb_buffers_until_unlocked(struct tree_balance *p_s_tb)
#ifdef CONFIG_REISERFS_CHECK #ifdef CONFIG_REISERFS_CHECK
repeat_counter++; repeat_counter++;
if ((repeat_counter % 10000) == 0) { if ((repeat_counter % 10000) == 0) {
reiserfs_warning(p_s_tb->tb_sb, reiserfs_warning(p_s_tb->tb_sb, "reiserfs-8200",
"wait_tb_buffers_until_released(): too many " "too many iterations waiting "
"iterations waiting for buffer to unlock " "for buffer to unlock "
"(%b)", locked); "(%b)", locked);
/* Don't loop forever. Try to recover from possible error. */ /* Don't loop forever. Try to recover from possible error. */
......
...@@ -842,7 +842,9 @@ int reiserfs_get_block(struct inode *inode, sector_t block, ...@@ -842,7 +842,9 @@ int reiserfs_get_block(struct inode *inode, sector_t block,
if (retval) { if (retval) {
if (retval != -ENOSPC) if (retval != -ENOSPC)
reiserfs_warning(inode->i_sb, reiserfs_warning(inode->i_sb,
"clm-6004: convert tail failed inode %lu, error %d", "clm-6004",
"convert tail failed "
"inode %lu, error %d",
inode->i_ino, inode->i_ino,
retval); retval);
if (allocated_block_nr) { if (allocated_block_nr) {
...@@ -1006,8 +1008,7 @@ int reiserfs_get_block(struct inode *inode, sector_t block, ...@@ -1006,8 +1008,7 @@ int reiserfs_get_block(struct inode *inode, sector_t block,
goto failure; goto failure;
} }
if (retval == POSITION_FOUND) { if (retval == POSITION_FOUND) {
reiserfs_warning(inode->i_sb, reiserfs_warning(inode->i_sb, "vs-825",
"vs-825: reiserfs_get_block: "
"%K should not be found", &key); "%K should not be found", &key);
retval = -EEXIST; retval = -EEXIST;
if (allocated_block_nr) if (allocated_block_nr)
...@@ -1332,9 +1333,9 @@ void reiserfs_update_sd_size(struct reiserfs_transaction_handle *th, ...@@ -1332,9 +1333,9 @@ void reiserfs_update_sd_size(struct reiserfs_transaction_handle *th,
/* look for the object's stat data */ /* look for the object's stat data */
retval = search_item(inode->i_sb, &key, &path); retval = search_item(inode->i_sb, &key, &path);
if (retval == IO_ERROR) { if (retval == IO_ERROR) {
reiserfs_warning(inode->i_sb, reiserfs_warning(inode->i_sb, "vs-13050",
"vs-13050: reiserfs_update_sd: " "i/o failure occurred trying to "
"i/o failure occurred trying to update %K stat data", "update %K stat data",
&key); &key);
return; return;
} }
...@@ -1345,9 +1346,9 @@ void reiserfs_update_sd_size(struct reiserfs_transaction_handle *th, ...@@ -1345,9 +1346,9 @@ void reiserfs_update_sd_size(struct reiserfs_transaction_handle *th,
/*reiserfs_warning (inode->i_sb, "vs-13050: reiserfs_update_sd: i_nlink == 0, stat data not found"); */ /*reiserfs_warning (inode->i_sb, "vs-13050: reiserfs_update_sd: i_nlink == 0, stat data not found"); */
return; return;
} }
reiserfs_warning(inode->i_sb, reiserfs_warning(inode->i_sb, "vs-13060",
"vs-13060: reiserfs_update_sd: " "stat data of object %k (nlink == %d) "
"stat data of object %k (nlink == %d) not found (pos %d)", "not found (pos %d)",
INODE_PKEY(inode), inode->i_nlink, INODE_PKEY(inode), inode->i_nlink,
pos); pos);
reiserfs_check_path(&path); reiserfs_check_path(&path);
...@@ -1424,10 +1425,9 @@ void reiserfs_read_locked_inode(struct inode *inode, ...@@ -1424,10 +1425,9 @@ void reiserfs_read_locked_inode(struct inode *inode,
/* look for the object's stat data */ /* look for the object's stat data */
retval = search_item(inode->i_sb, &key, &path_to_sd); retval = search_item(inode->i_sb, &key, &path_to_sd);
if (retval == IO_ERROR) { if (retval == IO_ERROR) {
reiserfs_warning(inode->i_sb, reiserfs_warning(inode->i_sb, "vs-13070",
"vs-13070: reiserfs_read_locked_inode: " "i/o failure occurred trying to find "
"i/o failure occurred trying to find stat data of %K", "stat data of %K", &key);
&key);
reiserfs_make_bad_inode(inode); reiserfs_make_bad_inode(inode);
return; return;
} }
...@@ -1457,8 +1457,7 @@ void reiserfs_read_locked_inode(struct inode *inode, ...@@ -1457,8 +1457,7 @@ void reiserfs_read_locked_inode(struct inode *inode,
during mount (fs/reiserfs/super.c:finish_unfinished()). */ during mount (fs/reiserfs/super.c:finish_unfinished()). */
if ((inode->i_nlink == 0) && if ((inode->i_nlink == 0) &&
!REISERFS_SB(inode->i_sb)->s_is_unlinked_ok) { !REISERFS_SB(inode->i_sb)->s_is_unlinked_ok) {
reiserfs_warning(inode->i_sb, reiserfs_warning(inode->i_sb, "vs-13075",
"vs-13075: reiserfs_read_locked_inode: "
"dead inode read from disk %K. " "dead inode read from disk %K. "
"This is likely to be race with knfsd. Ignore", "This is likely to be race with knfsd. Ignore",
&key); &key);
...@@ -1555,7 +1554,7 @@ struct dentry *reiserfs_fh_to_dentry(struct super_block *sb, struct fid *fid, ...@@ -1555,7 +1554,7 @@ struct dentry *reiserfs_fh_to_dentry(struct super_block *sb, struct fid *fid,
*/ */
if (fh_type > fh_len) { if (fh_type > fh_len) {
if (fh_type != 6 || fh_len != 5) if (fh_type != 6 || fh_len != 5)
reiserfs_warning(sb, reiserfs_warning(sb, "reiserfs-13077",
"nfsd/reiserfs, fhtype=%d, len=%d - odd", "nfsd/reiserfs, fhtype=%d, len=%d - odd",
fh_type, fh_len); fh_type, fh_len);
fh_type = 5; fh_type = 5;
...@@ -1680,13 +1679,13 @@ static int reiserfs_new_directory(struct reiserfs_transaction_handle *th, ...@@ -1680,13 +1679,13 @@ static int reiserfs_new_directory(struct reiserfs_transaction_handle *th,
/* look for place in the tree for new item */ /* look for place in the tree for new item */
retval = search_item(sb, &key, path); retval = search_item(sb, &key, path);
if (retval == IO_ERROR) { if (retval == IO_ERROR) {
reiserfs_warning(sb, "vs-13080: reiserfs_new_directory: " reiserfs_warning(sb, "vs-13080",
"i/o failure occurred creating new directory"); "i/o failure occurred creating new directory");
return -EIO; return -EIO;
} }
if (retval == ITEM_FOUND) { if (retval == ITEM_FOUND) {
pathrelse(path); pathrelse(path);
reiserfs_warning(sb, "vs-13070: reiserfs_new_directory: " reiserfs_warning(sb, "vs-13070",
"object with this key exists (%k)", "object with this key exists (%k)",
&(ih->ih_key)); &(ih->ih_key));
return -EEXIST; return -EEXIST;
...@@ -1720,13 +1719,13 @@ static int reiserfs_new_symlink(struct reiserfs_transaction_handle *th, struct i ...@@ -1720,13 +1719,13 @@ static int reiserfs_new_symlink(struct reiserfs_transaction_handle *th, struct i
/* look for place in the tree for new item */ /* look for place in the tree for new item */
retval = search_item(sb, &key, path); retval = search_item(sb, &key, path);
if (retval == IO_ERROR) { if (retval == IO_ERROR) {
reiserfs_warning(sb, "vs-13080: reiserfs_new_symlinik: " reiserfs_warning(sb, "vs-13080",
"i/o failure occurred creating new symlink"); "i/o failure occurred creating new symlink");
return -EIO; return -EIO;
} }
if (retval == ITEM_FOUND) { if (retval == ITEM_FOUND) {
pathrelse(path); pathrelse(path);
reiserfs_warning(sb, "vs-13080: reiserfs_new_symlink: " reiserfs_warning(sb, "vs-13080",
"object with this key exists (%k)", "object with this key exists (%k)",
&(ih->ih_key)); &(ih->ih_key));
return -EEXIST; return -EEXIST;
...@@ -1927,7 +1926,8 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th, ...@@ -1927,7 +1926,8 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th,
goto out_inserted_sd; goto out_inserted_sd;
} }
} else if (inode->i_sb->s_flags & MS_POSIXACL) { } else if (inode->i_sb->s_flags & MS_POSIXACL) {
reiserfs_warning(inode->i_sb, "ACLs aren't enabled in the fs, " reiserfs_warning(inode->i_sb, "jdm-13090",
"ACLs aren't enabled in the fs, "
"but vfs thinks they are!"); "but vfs thinks they are!");
} else if (is_reiserfs_priv_object(dir)) { } else if (is_reiserfs_priv_object(dir)) {
reiserfs_mark_inode_private(inode); reiserfs_mark_inode_private(inode);
...@@ -2044,8 +2044,8 @@ static int grab_tail_page(struct inode *p_s_inode, ...@@ -2044,8 +2044,8 @@ static int grab_tail_page(struct inode *p_s_inode,
** I've screwed up the code to find the buffer, or the code to ** I've screwed up the code to find the buffer, or the code to
** call prepare_write ** call prepare_write
*/ */
reiserfs_warning(p_s_inode->i_sb, reiserfs_warning(p_s_inode->i_sb, "clm-6000",
"clm-6000: error reading block %lu on dev %s", "error reading block %lu on dev %s",
bh->b_blocknr, bh->b_blocknr,
reiserfs_bdevname(p_s_inode->i_sb)); reiserfs_bdevname(p_s_inode->i_sb));
error = -EIO; error = -EIO;
...@@ -2089,8 +2089,8 @@ int reiserfs_truncate_file(struct inode *p_s_inode, int update_timestamps) ...@@ -2089,8 +2089,8 @@ int reiserfs_truncate_file(struct inode *p_s_inode, int update_timestamps)
// and get_block_create_0 could not find a block to read in, // and get_block_create_0 could not find a block to read in,
// which is ok. // which is ok.
if (error != -ENOENT) if (error != -ENOENT)
reiserfs_warning(p_s_inode->i_sb, reiserfs_warning(p_s_inode->i_sb, "clm-6001",
"clm-6001: grab_tail_page failed %d", "grab_tail_page failed %d",
error); error);
page = NULL; page = NULL;
bh = NULL; bh = NULL;
...@@ -2208,9 +2208,8 @@ static int map_block_for_writepage(struct inode *inode, ...@@ -2208,9 +2208,8 @@ static int map_block_for_writepage(struct inode *inode,
/* we've found an unformatted node */ /* we've found an unformatted node */
if (indirect_item_found(retval, ih)) { if (indirect_item_found(retval, ih)) {
if (bytes_copied > 0) { if (bytes_copied > 0) {
reiserfs_warning(inode->i_sb, reiserfs_warning(inode->i_sb, "clm-6002",
"clm-6002: bytes_copied %d", "bytes_copied %d", bytes_copied);
bytes_copied);
} }
if (!get_block_num(item, pos_in_item)) { if (!get_block_num(item, pos_in_item)) {
/* crap, we are writing to a hole */ /* crap, we are writing to a hole */
...@@ -2267,9 +2266,8 @@ static int map_block_for_writepage(struct inode *inode, ...@@ -2267,9 +2266,8 @@ static int map_block_for_writepage(struct inode *inode,
goto research; goto research;
} }
} else { } else {
reiserfs_warning(inode->i_sb, reiserfs_warning(inode->i_sb, "clm-6003",
"clm-6003: bad item inode %lu, device %s", "bad item inode %lu", inode->i_ino);
inode->i_ino, reiserfs_bdevname(inode->i_sb));
retval = -EIO; retval = -EIO;
goto out; goto out;
} }
......
...@@ -97,7 +97,8 @@ static int sd_unit_num(struct virtual_item *vi) ...@@ -97,7 +97,8 @@ static int sd_unit_num(struct virtual_item *vi)
static void sd_print_vi(struct virtual_item *vi) static void sd_print_vi(struct virtual_item *vi)
{ {
reiserfs_warning(NULL, "STATDATA, index %d, type 0x%x, %h", reiserfs_warning(NULL, "reiserfs-16100",
"STATDATA, index %d, type 0x%x, %h",
vi->vi_index, vi->vi_type, vi->vi_ih); vi->vi_index, vi->vi_type, vi->vi_ih);
} }
...@@ -190,7 +191,8 @@ static int direct_unit_num(struct virtual_item *vi) ...@@ -190,7 +191,8 @@ static int direct_unit_num(struct virtual_item *vi)
static void direct_print_vi(struct virtual_item *vi) static void direct_print_vi(struct virtual_item *vi)
{ {
reiserfs_warning(NULL, "DIRECT, index %d, type 0x%x, %h", reiserfs_warning(NULL, "reiserfs-16101",
"DIRECT, index %d, type 0x%x, %h",
vi->vi_index, vi->vi_type, vi->vi_ih); vi->vi_index, vi->vi_type, vi->vi_ih);
} }
...@@ -278,7 +280,7 @@ static void indirect_print_item(struct item_head *ih, char *item) ...@@ -278,7 +280,7 @@ static void indirect_print_item(struct item_head *ih, char *item)
unp = (__le32 *) item; unp = (__le32 *) item;
if (ih_item_len(ih) % UNFM_P_SIZE) if (ih_item_len(ih) % UNFM_P_SIZE)
reiserfs_warning(NULL, "indirect_print_item: invalid item len"); reiserfs_warning(NULL, "reiserfs-16102", "invalid item len");
printk("%d pointers\n[ ", (int)I_UNFM_NUM(ih)); printk("%d pointers\n[ ", (int)I_UNFM_NUM(ih));
for (j = 0; j < I_UNFM_NUM(ih); j++) { for (j = 0; j < I_UNFM_NUM(ih); j++) {
...@@ -334,7 +336,8 @@ static int indirect_unit_num(struct virtual_item *vi) ...@@ -334,7 +336,8 @@ static int indirect_unit_num(struct virtual_item *vi)
static void indirect_print_vi(struct virtual_item *vi) static void indirect_print_vi(struct virtual_item *vi)
{ {
reiserfs_warning(NULL, "INDIRECT, index %d, type 0x%x, %h", reiserfs_warning(NULL, "reiserfs-16103",
"INDIRECT, index %d, type 0x%x, %h",
vi->vi_index, vi->vi_type, vi->vi_ih); vi->vi_index, vi->vi_type, vi->vi_ih);
} }
...@@ -359,7 +362,7 @@ static struct item_operations indirect_ops = { ...@@ -359,7 +362,7 @@ static struct item_operations indirect_ops = {
static int direntry_bytes_number(struct item_head *ih, int block_size) static int direntry_bytes_number(struct item_head *ih, int block_size)
{ {
reiserfs_warning(NULL, "vs-16090: direntry_bytes_number: " reiserfs_warning(NULL, "vs-16090",
"bytes number is asked for direntry"); "bytes number is asked for direntry");
return 0; return 0;
} }
...@@ -614,7 +617,8 @@ static void direntry_print_vi(struct virtual_item *vi) ...@@ -614,7 +617,8 @@ static void direntry_print_vi(struct virtual_item *vi)
int i; int i;
struct direntry_uarea *dir_u = vi->vi_uarea; struct direntry_uarea *dir_u = vi->vi_uarea;
reiserfs_warning(NULL, "DIRENTRY, index %d, type 0x%x, %h, flags 0x%x", reiserfs_warning(NULL, "reiserfs-16104",
"DIRENTRY, index %d, type 0x%x, %h, flags 0x%x",
vi->vi_index, vi->vi_type, vi->vi_ih, dir_u->flags); vi->vi_index, vi->vi_type, vi->vi_ih, dir_u->flags);
printk("%d entries: ", dir_u->entry_count); printk("%d entries: ", dir_u->entry_count);
for (i = 0; i < dir_u->entry_count; i++) for (i = 0; i < dir_u->entry_count; i++)
...@@ -642,43 +646,43 @@ static struct item_operations direntry_ops = { ...@@ -642,43 +646,43 @@ static struct item_operations direntry_ops = {
// //
static int errcatch_bytes_number(struct item_head *ih, int block_size) static int errcatch_bytes_number(struct item_head *ih, int block_size)
{ {
reiserfs_warning(NULL, reiserfs_warning(NULL, "green-16001",
"green-16001: Invalid item type observed, run fsck ASAP"); "Invalid item type observed, run fsck ASAP");
return 0; return 0;
} }
static void errcatch_decrement_key(struct cpu_key *key) static void errcatch_decrement_key(struct cpu_key *key)
{ {
reiserfs_warning(NULL, reiserfs_warning(NULL, "green-16002",
"green-16002: Invalid item type observed, run fsck ASAP"); "Invalid item type observed, run fsck ASAP");
} }
static int errcatch_is_left_mergeable(struct reiserfs_key *key, static int errcatch_is_left_mergeable(struct reiserfs_key *key,
unsigned long bsize) unsigned long bsize)
{ {
reiserfs_warning(NULL, reiserfs_warning(NULL, "green-16003",
"green-16003: Invalid item type observed, run fsck ASAP"); "Invalid item type observed, run fsck ASAP");
return 0; return 0;
} }
static void errcatch_print_item(struct item_head *ih, char *item) static void errcatch_print_item(struct item_head *ih, char *item)
{ {
reiserfs_warning(NULL, reiserfs_warning(NULL, "green-16004",
"green-16004: Invalid item type observed, run fsck ASAP"); "Invalid item type observed, run fsck ASAP");
} }
static void errcatch_check_item(struct item_head *ih, char *item) static void errcatch_check_item(struct item_head *ih, char *item)
{ {
reiserfs_warning(NULL, reiserfs_warning(NULL, "green-16005",
"green-16005: Invalid item type observed, run fsck ASAP"); "Invalid item type observed, run fsck ASAP");
} }
static int errcatch_create_vi(struct virtual_node *vn, static int errcatch_create_vi(struct virtual_node *vn,
struct virtual_item *vi, struct virtual_item *vi,
int is_affected, int insert_size) int is_affected, int insert_size)
{ {
reiserfs_warning(NULL, reiserfs_warning(NULL, "green-16006",
"green-16006: Invalid item type observed, run fsck ASAP"); "Invalid item type observed, run fsck ASAP");
return 0; // We might return -1 here as well, but it won't help as create_virtual_node() from where return 0; // We might return -1 here as well, but it won't help as create_virtual_node() from where
// this operation is called from is of return type void. // this operation is called from is of return type void.
} }
...@@ -686,36 +690,36 @@ static int errcatch_create_vi(struct virtual_node *vn, ...@@ -686,36 +690,36 @@ static int errcatch_create_vi(struct virtual_node *vn,
static int errcatch_check_left(struct virtual_item *vi, int free, static int errcatch_check_left(struct virtual_item *vi, int free,
int start_skip, int end_skip) int start_skip, int end_skip)
{ {
reiserfs_warning(NULL, reiserfs_warning(NULL, "green-16007",
"green-16007: Invalid item type observed, run fsck ASAP"); "Invalid item type observed, run fsck ASAP");
return -1; return -1;
} }
static int errcatch_check_right(struct virtual_item *vi, int free) static int errcatch_check_right(struct virtual_item *vi, int free)
{ {
reiserfs_warning(NULL, reiserfs_warning(NULL, "green-16008",
"green-16008: Invalid item type observed, run fsck ASAP"); "Invalid item type observed, run fsck ASAP");
return -1; return -1;
} }
static int errcatch_part_size(struct virtual_item *vi, int first, int count) static int errcatch_part_size(struct virtual_item *vi, int first, int count)
{ {
reiserfs_warning(NULL, reiserfs_warning(NULL, "green-16009",
"green-16009: Invalid item type observed, run fsck ASAP"); "Invalid item type observed, run fsck ASAP");
return 0; return 0;
} }
static int errcatch_unit_num(struct virtual_item *vi) static int errcatch_unit_num(struct virtual_item *vi)
{ {
reiserfs_warning(NULL, reiserfs_warning(NULL, "green-16010",
"green-16010: Invalid item type observed, run fsck ASAP"); "Invalid item type observed, run fsck ASAP");
return 0; return 0;
} }
static void errcatch_print_vi(struct virtual_item *vi) static void errcatch_print_vi(struct virtual_item *vi)
{ {
reiserfs_warning(NULL, reiserfs_warning(NULL, "green-16011",
"green-16011: Invalid item type observed, run fsck ASAP"); "Invalid item type observed, run fsck ASAP");
} }
static struct item_operations errcatch_ops = { static struct item_operations errcatch_ops = {
......
...@@ -300,8 +300,8 @@ int reiserfs_allocate_list_bitmaps(struct super_block *p_s_sb, ...@@ -300,8 +300,8 @@ int reiserfs_allocate_list_bitmaps(struct super_block *p_s_sb,
jb->journal_list = NULL; jb->journal_list = NULL;
jb->bitmaps = vmalloc(mem); jb->bitmaps = vmalloc(mem);
if (!jb->bitmaps) { if (!jb->bitmaps) {
reiserfs_warning(p_s_sb, reiserfs_warning(p_s_sb, "clm-2000", "unable to "
"clm-2000, unable to allocate bitmaps for journal lists"); "allocate bitmaps for journal lists");
failed = 1; failed = 1;
break; break;
} }
...@@ -644,8 +644,8 @@ static void reiserfs_end_buffer_io_sync(struct buffer_head *bh, int uptodate) ...@@ -644,8 +644,8 @@ static void reiserfs_end_buffer_io_sync(struct buffer_head *bh, int uptodate)
char b[BDEVNAME_SIZE]; char b[BDEVNAME_SIZE];
if (buffer_journaled(bh)) { if (buffer_journaled(bh)) {
reiserfs_warning(NULL, reiserfs_warning(NULL, "clm-2084",
"clm-2084: pinned buffer %lu:%s sent to disk", "pinned buffer %lu:%s sent to disk",
bh->b_blocknr, bdevname(bh->b_bdev, b)); bh->b_blocknr, bdevname(bh->b_bdev, b));
} }
if (uptodate) if (uptodate)
...@@ -1122,7 +1122,8 @@ static int flush_commit_list(struct super_block *s, ...@@ -1122,7 +1122,8 @@ static int flush_commit_list(struct super_block *s,
sync_dirty_buffer(tbh); sync_dirty_buffer(tbh);
if (unlikely(!buffer_uptodate(tbh))) { if (unlikely(!buffer_uptodate(tbh))) {
#ifdef CONFIG_REISERFS_CHECK #ifdef CONFIG_REISERFS_CHECK
reiserfs_warning(s, "journal-601, buffer write failed"); reiserfs_warning(s, "journal-601",
"buffer write failed");
#endif #endif
retval = -EIO; retval = -EIO;
} }
...@@ -1154,14 +1155,14 @@ static int flush_commit_list(struct super_block *s, ...@@ -1154,14 +1155,14 @@ static int flush_commit_list(struct super_block *s,
* up propagating the write error out to the filesystem. */ * up propagating the write error out to the filesystem. */
if (unlikely(!buffer_uptodate(jl->j_commit_bh))) { if (unlikely(!buffer_uptodate(jl->j_commit_bh))) {
#ifdef CONFIG_REISERFS_CHECK #ifdef CONFIG_REISERFS_CHECK
reiserfs_warning(s, "journal-615: buffer write failed"); reiserfs_warning(s, "journal-615", "buffer write failed");
#endif #endif
retval = -EIO; retval = -EIO;
} }
bforget(jl->j_commit_bh); bforget(jl->j_commit_bh);
if (journal->j_last_commit_id != 0 && if (journal->j_last_commit_id != 0 &&
(jl->j_trans_id - journal->j_last_commit_id) != 1) { (jl->j_trans_id - journal->j_last_commit_id) != 1) {
reiserfs_warning(s, "clm-2200: last commit %lu, current %lu", reiserfs_warning(s, "clm-2200", "last commit %lu, current %lu",
journal->j_last_commit_id, jl->j_trans_id); journal->j_last_commit_id, jl->j_trans_id);
} }
journal->j_last_commit_id = jl->j_trans_id; 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,7 +1251,7 @@ static void remove_all_from_journal_list(struct super_block *p_s_sb,
while (cn) { while (cn) {
if (cn->blocknr != 0) { if (cn->blocknr != 0) {
if (debug) { if (debug) {
reiserfs_warning(p_s_sb, reiserfs_warning(p_s_sb, "reiserfs-2201",
"block %u, bh is %d, state %ld", "block %u, bh is %d, state %ld",
cn->blocknr, cn->bh ? 1 : 0, cn->blocknr, cn->bh ? 1 : 0,
cn->state); cn->state);
...@@ -1288,8 +1289,8 @@ static int _update_journal_header_block(struct super_block *p_s_sb, ...@@ -1288,8 +1289,8 @@ static int _update_journal_header_block(struct super_block *p_s_sb,
wait_on_buffer((journal->j_header_bh)); wait_on_buffer((journal->j_header_bh));
if (unlikely(!buffer_uptodate(journal->j_header_bh))) { if (unlikely(!buffer_uptodate(journal->j_header_bh))) {
#ifdef CONFIG_REISERFS_CHECK #ifdef CONFIG_REISERFS_CHECK
reiserfs_warning(p_s_sb, reiserfs_warning(p_s_sb, "journal-699",
"journal-699: buffer write failed"); "buffer write failed");
#endif #endif
return -EIO; return -EIO;
} }
...@@ -1319,8 +1320,8 @@ static int _update_journal_header_block(struct super_block *p_s_sb, ...@@ -1319,8 +1320,8 @@ static int _update_journal_header_block(struct super_block *p_s_sb,
sync_dirty_buffer(journal->j_header_bh); sync_dirty_buffer(journal->j_header_bh);
} }
if (!buffer_uptodate(journal->j_header_bh)) { if (!buffer_uptodate(journal->j_header_bh)) {
reiserfs_warning(p_s_sb, reiserfs_warning(p_s_sb, "journal-837",
"journal-837: IO error during journal replay"); "IO error during journal replay");
return -EIO; return -EIO;
} }
} }
...@@ -1401,8 +1402,7 @@ static int flush_journal_list(struct super_block *s, ...@@ -1401,8 +1402,7 @@ static int flush_journal_list(struct super_block *s,
BUG_ON(j_len_saved <= 0); BUG_ON(j_len_saved <= 0);
if (atomic_read(&journal->j_wcount) != 0) { if (atomic_read(&journal->j_wcount) != 0) {
reiserfs_warning(s, reiserfs_warning(s, "clm-2048", "called with wcount %d",
"clm-2048: flush_journal_list called with wcount %d",
atomic_read(&journal->j_wcount)); atomic_read(&journal->j_wcount));
} }
BUG_ON(jl->j_trans_id == 0); BUG_ON(jl->j_trans_id == 0);
...@@ -1510,8 +1510,8 @@ static int flush_journal_list(struct super_block *s, ...@@ -1510,8 +1510,8 @@ static int flush_journal_list(struct super_block *s,
** is not marked JDirty_wait ** is not marked JDirty_wait
*/ */
if ((!was_jwait) && !buffer_locked(saved_bh)) { if ((!was_jwait) && !buffer_locked(saved_bh)) {
reiserfs_warning(s, reiserfs_warning(s, "journal-813",
"journal-813: BAD! buffer %llu %cdirty %cjwait, " "BAD! buffer %llu %cdirty %cjwait, "
"not in a newer tranasction", "not in a newer tranasction",
(unsigned long long)saved_bh-> (unsigned long long)saved_bh->
b_blocknr, was_dirty ? ' ' : '!', b_blocknr, was_dirty ? ' ' : '!',
...@@ -1529,8 +1529,8 @@ static int flush_journal_list(struct super_block *s, ...@@ -1529,8 +1529,8 @@ static int flush_journal_list(struct super_block *s,
unlock_buffer(saved_bh); unlock_buffer(saved_bh);
count++; count++;
} else { } else {
reiserfs_warning(s, reiserfs_warning(s, "clm-2082",
"clm-2082: Unable to flush buffer %llu in %s", "Unable to flush buffer %llu in %s",
(unsigned long long)saved_bh-> (unsigned long long)saved_bh->
b_blocknr, __func__); b_blocknr, __func__);
} }
...@@ -1541,8 +1541,8 @@ static int flush_journal_list(struct super_block *s, ...@@ -1541,8 +1541,8 @@ static int flush_journal_list(struct super_block *s,
/* we incremented this to keep others from taking the buffer head away */ /* we incremented this to keep others from taking the buffer head away */
put_bh(saved_bh); put_bh(saved_bh);
if (atomic_read(&(saved_bh->b_count)) < 0) { if (atomic_read(&(saved_bh->b_count)) < 0) {
reiserfs_warning(s, reiserfs_warning(s, "journal-945",
"journal-945: saved_bh->b_count < 0"); "saved_bh->b_count < 0");
} }
} }
} }
...@@ -1561,8 +1561,8 @@ static int flush_journal_list(struct super_block *s, ...@@ -1561,8 +1561,8 @@ static int flush_journal_list(struct super_block *s,
} }
if (unlikely(!buffer_uptodate(cn->bh))) { if (unlikely(!buffer_uptodate(cn->bh))) {
#ifdef CONFIG_REISERFS_CHECK #ifdef CONFIG_REISERFS_CHECK
reiserfs_warning(s, reiserfs_warning(s, "journal-949",
"journal-949: buffer write failed\n"); "buffer write failed");
#endif #endif
err = -EIO; err = -EIO;
} }
...@@ -1623,7 +1623,7 @@ static int flush_journal_list(struct super_block *s, ...@@ -1623,7 +1623,7 @@ static int flush_journal_list(struct super_block *s,
if (journal->j_last_flush_id != 0 && if (journal->j_last_flush_id != 0 &&
(jl->j_trans_id - journal->j_last_flush_id) != 1) { (jl->j_trans_id - journal->j_last_flush_id) != 1) {
reiserfs_warning(s, "clm-2201: last flush %lu, current %lu", reiserfs_warning(s, "clm-2201", "last flush %lu, current %lu",
journal->j_last_flush_id, jl->j_trans_id); journal->j_last_flush_id, jl->j_trans_id);
} }
journal->j_last_flush_id = jl->j_trans_id; 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,8 +2058,9 @@ static int journal_transaction_is_valid(struct super_block *p_s_sb,
return -1; return -1;
} }
if (get_desc_trans_len(desc) > SB_JOURNAL(p_s_sb)->j_trans_max) { if (get_desc_trans_len(desc) > SB_JOURNAL(p_s_sb)->j_trans_max) {
reiserfs_warning(p_s_sb, reiserfs_warning(p_s_sb, "journal-2018",
"journal-2018: Bad transaction length %d encountered, ignoring transaction", "Bad transaction length %d "
"encountered, ignoring transaction",
get_desc_trans_len(desc)); get_desc_trans_len(desc));
return -1; return -1;
} }
...@@ -2195,8 +2196,8 @@ static int journal_read_transaction(struct super_block *p_s_sb, ...@@ -2195,8 +2196,8 @@ static int journal_read_transaction(struct super_block *p_s_sb,
brelse(d_bh); brelse(d_bh);
kfree(log_blocks); kfree(log_blocks);
kfree(real_blocks); kfree(real_blocks);
reiserfs_warning(p_s_sb, reiserfs_warning(p_s_sb, "journal-1169",
"journal-1169: kmalloc failed, unable to mount FS"); "kmalloc failed, unable to mount FS");
return -1; return -1;
} }
/* get all the buffer heads */ /* get all the buffer heads */
...@@ -2218,15 +2219,18 @@ static int journal_read_transaction(struct super_block *p_s_sb, ...@@ -2218,15 +2219,18 @@ static int journal_read_transaction(struct super_block *p_s_sb,
j_realblock[i - trans_half])); j_realblock[i - trans_half]));
} }
if (real_blocks[i]->b_blocknr > SB_BLOCK_COUNT(p_s_sb)) { if (real_blocks[i]->b_blocknr > SB_BLOCK_COUNT(p_s_sb)) {
reiserfs_warning(p_s_sb, reiserfs_warning(p_s_sb, "journal-1207",
"journal-1207: REPLAY FAILURE fsck required! Block to replay is outside of filesystem"); "REPLAY FAILURE fsck required! "
"Block to replay is outside of "
"filesystem");
goto abort_replay; goto abort_replay;
} }
/* make sure we don't try to replay onto log or reserved area */ /* make sure we don't try to replay onto log or reserved area */
if (is_block_in_log_or_reserved_area if (is_block_in_log_or_reserved_area
(p_s_sb, real_blocks[i]->b_blocknr)) { (p_s_sb, real_blocks[i]->b_blocknr)) {
reiserfs_warning(p_s_sb, reiserfs_warning(p_s_sb, "journal-1204",
"journal-1204: REPLAY FAILURE fsck required! Trying to replay onto a log block"); "REPLAY FAILURE fsck required! "
"Trying to replay onto a log block");
abort_replay: abort_replay:
brelse_array(log_blocks, i); brelse_array(log_blocks, i);
brelse_array(real_blocks, i); brelse_array(real_blocks, i);
...@@ -2242,8 +2246,9 @@ static int journal_read_transaction(struct super_block *p_s_sb, ...@@ -2242,8 +2246,9 @@ static int journal_read_transaction(struct super_block *p_s_sb,
for (i = 0; i < get_desc_trans_len(desc); i++) { for (i = 0; i < get_desc_trans_len(desc); i++) {
wait_on_buffer(log_blocks[i]); wait_on_buffer(log_blocks[i]);
if (!buffer_uptodate(log_blocks[i])) { if (!buffer_uptodate(log_blocks[i])) {
reiserfs_warning(p_s_sb, reiserfs_warning(p_s_sb, "journal-1212",
"journal-1212: REPLAY FAILURE fsck required! buffer write failed"); "REPLAY FAILURE fsck required! "
"buffer write failed");
brelse_array(log_blocks + i, brelse_array(log_blocks + i,
get_desc_trans_len(desc) - i); get_desc_trans_len(desc) - i);
brelse_array(real_blocks, get_desc_trans_len(desc)); 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,8 +2271,9 @@ static int journal_read_transaction(struct super_block *p_s_sb,
for (i = 0; i < get_desc_trans_len(desc); i++) { for (i = 0; i < get_desc_trans_len(desc); i++) {
wait_on_buffer(real_blocks[i]); wait_on_buffer(real_blocks[i]);
if (!buffer_uptodate(real_blocks[i])) { if (!buffer_uptodate(real_blocks[i])) {
reiserfs_warning(p_s_sb, reiserfs_warning(p_s_sb, "journal-1226",
"journal-1226: REPLAY FAILURE, fsck required! buffer write failed"); "REPLAY FAILURE, fsck required! "
"buffer write failed");
brelse_array(real_blocks + i, brelse_array(real_blocks + i,
get_desc_trans_len(desc) - i); get_desc_trans_len(desc) - i);
brelse(c_bh); brelse(c_bh);
...@@ -2418,8 +2424,8 @@ static int journal_read(struct super_block *p_s_sb) ...@@ -2418,8 +2424,8 @@ static int journal_read(struct super_block *p_s_sb)
} }
if (continue_replay && bdev_read_only(p_s_sb->s_bdev)) { if (continue_replay && bdev_read_only(p_s_sb->s_bdev)) {
reiserfs_warning(p_s_sb, reiserfs_warning(p_s_sb, "clm-2076",
"clm-2076: device is readonly, unable to replay log"); "device is readonly, unable to replay log");
return -1; return -1;
} }
...@@ -2580,9 +2586,8 @@ static int release_journal_dev(struct super_block *super, ...@@ -2580,9 +2586,8 @@ static int release_journal_dev(struct super_block *super,
} }
if (result != 0) { if (result != 0) {
reiserfs_warning(super, reiserfs_warning(super, "sh-457",
"sh-457: release_journal_dev: Cannot release journal device: %i", "Cannot release journal device: %i", result);
result);
} }
return result; return result;
} }
...@@ -2612,7 +2617,7 @@ static int journal_init_dev(struct super_block *super, ...@@ -2612,7 +2617,7 @@ static int journal_init_dev(struct super_block *super,
if (IS_ERR(journal->j_dev_bd)) { if (IS_ERR(journal->j_dev_bd)) {
result = PTR_ERR(journal->j_dev_bd); result = PTR_ERR(journal->j_dev_bd);
journal->j_dev_bd = NULL; journal->j_dev_bd = NULL;
reiserfs_warning(super, "sh-458: journal_init_dev: " reiserfs_warning(super, "sh-458",
"cannot init journal device '%s': %i", "cannot init journal device '%s': %i",
__bdevname(jdev, b), result); __bdevname(jdev, b), result);
return result; return result;
...@@ -2676,16 +2681,16 @@ static int check_advise_trans_params(struct super_block *p_s_sb, ...@@ -2676,16 +2681,16 @@ static int check_advise_trans_params(struct super_block *p_s_sb,
journal->j_trans_max < JOURNAL_TRANS_MIN_DEFAULT / ratio || journal->j_trans_max < JOURNAL_TRANS_MIN_DEFAULT / ratio ||
SB_ONDISK_JOURNAL_SIZE(p_s_sb) / journal->j_trans_max < SB_ONDISK_JOURNAL_SIZE(p_s_sb) / journal->j_trans_max <
JOURNAL_MIN_RATIO) { JOURNAL_MIN_RATIO) {
reiserfs_warning(p_s_sb, reiserfs_warning(p_s_sb, "sh-462",
"sh-462: bad transaction max size (%u). FSCK?", "bad transaction max size (%u). "
journal->j_trans_max); "FSCK?", journal->j_trans_max);
return 1; return 1;
} }
if (journal->j_max_batch != (journal->j_trans_max) * if (journal->j_max_batch != (journal->j_trans_max) *
JOURNAL_MAX_BATCH_DEFAULT/JOURNAL_TRANS_MAX_DEFAULT) { JOURNAL_MAX_BATCH_DEFAULT/JOURNAL_TRANS_MAX_DEFAULT) {
reiserfs_warning(p_s_sb, reiserfs_warning(p_s_sb, "sh-463",
"sh-463: bad transaction max batch (%u). FSCK?", "bad transaction max batch (%u). "
journal->j_max_batch); "FSCK?", journal->j_max_batch);
return 1; return 1;
} }
} else { } else {
...@@ -2693,9 +2698,11 @@ static int check_advise_trans_params(struct super_block *p_s_sb, ...@@ -2693,9 +2698,11 @@ static int check_advise_trans_params(struct super_block *p_s_sb,
The file system was created by old version The file system was created by old version
of mkreiserfs, so some fields contain zeros, of mkreiserfs, so some fields contain zeros,
and we need to advise proper values for them */ and we need to advise proper values for them */
if (p_s_sb->s_blocksize != REISERFS_STANDARD_BLKSIZE) if (p_s_sb->s_blocksize != REISERFS_STANDARD_BLKSIZE) {
reiserfs_panic(p_s_sb, "sh-464: bad blocksize (%u)", reiserfs_warning(p_s_sb, "sh-464", "bad blocksize (%u)",
p_s_sb->s_blocksize); p_s_sb->s_blocksize);
return 1;
}
journal->j_trans_max = JOURNAL_TRANS_MAX_DEFAULT; journal->j_trans_max = JOURNAL_TRANS_MAX_DEFAULT;
journal->j_max_batch = JOURNAL_MAX_BATCH_DEFAULT; journal->j_max_batch = JOURNAL_MAX_BATCH_DEFAULT;
journal->j_max_commit_age = JOURNAL_MAX_COMMIT_AGE; 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,8 +2726,8 @@ int journal_init(struct super_block *p_s_sb, const char *j_dev_name,
journal = SB_JOURNAL(p_s_sb) = vmalloc(sizeof(struct reiserfs_journal)); journal = SB_JOURNAL(p_s_sb) = vmalloc(sizeof(struct reiserfs_journal));
if (!journal) { if (!journal) {
reiserfs_warning(p_s_sb, reiserfs_warning(p_s_sb, "journal-1256",
"journal-1256: unable to get memory for journal structure"); "unable to get memory for journal structure");
return 1; return 1;
} }
memset(journal, 0, sizeof(struct reiserfs_journal)); 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,9 +2756,9 @@ int journal_init(struct super_block *p_s_sb, const char *j_dev_name,
if (!SB_ONDISK_JOURNAL_DEVICE(p_s_sb) && if (!SB_ONDISK_JOURNAL_DEVICE(p_s_sb) &&
(SB_JOURNAL_1st_RESERVED_BLOCK(p_s_sb) + (SB_JOURNAL_1st_RESERVED_BLOCK(p_s_sb) +
SB_ONDISK_JOURNAL_SIZE(p_s_sb) > p_s_sb->s_blocksize * 8)) { SB_ONDISK_JOURNAL_SIZE(p_s_sb) > p_s_sb->s_blocksize * 8)) {
reiserfs_warning(p_s_sb, reiserfs_warning(p_s_sb, "journal-1393",
"journal-1393: journal does not fit for area " "journal does not fit for area addressed "
"addressed by first of bitmap blocks. It starts at " "by first of bitmap blocks. It starts at "
"%u and its size is %u. Block size %ld", "%u and its size is %u. Block size %ld",
SB_JOURNAL_1st_RESERVED_BLOCK(p_s_sb), SB_JOURNAL_1st_RESERVED_BLOCK(p_s_sb),
SB_ONDISK_JOURNAL_SIZE(p_s_sb), 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,8 +2767,8 @@ int journal_init(struct super_block *p_s_sb, const char *j_dev_name,
} }
if (journal_init_dev(p_s_sb, journal, j_dev_name) != 0) { if (journal_init_dev(p_s_sb, journal, j_dev_name) != 0) {
reiserfs_warning(p_s_sb, reiserfs_warning(p_s_sb, "sh-462",
"sh-462: unable to initialize jornal device"); "unable to initialize jornal device");
goto free_and_return; goto free_and_return;
} }
...@@ -2772,8 +2779,8 @@ int journal_init(struct super_block *p_s_sb, const char *j_dev_name, ...@@ -2772,8 +2779,8 @@ int journal_init(struct super_block *p_s_sb, const char *j_dev_name,
SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb) + SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb) +
SB_ONDISK_JOURNAL_SIZE(p_s_sb)); SB_ONDISK_JOURNAL_SIZE(p_s_sb));
if (!bhjh) { if (!bhjh) {
reiserfs_warning(p_s_sb, reiserfs_warning(p_s_sb, "sh-459",
"sh-459: unable to read journal header"); "unable to read journal header");
goto free_and_return; goto free_and_return;
} }
jh = (struct reiserfs_journal_header *)(bhjh->b_data); 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,10 +2789,10 @@ int journal_init(struct super_block *p_s_sb, const char *j_dev_name,
if (is_reiserfs_jr(rs) if (is_reiserfs_jr(rs)
&& (le32_to_cpu(jh->jh_journal.jp_journal_magic) != && (le32_to_cpu(jh->jh_journal.jp_journal_magic) !=
sb_jp_journal_magic(rs))) { sb_jp_journal_magic(rs))) {
reiserfs_warning(p_s_sb, reiserfs_warning(p_s_sb, "sh-460",
"sh-460: journal header magic %x " "journal header magic %x (device %s) does "
"(device %s) does not match to magic found in super " "not match to magic found in super block %x",
"block %x", jh->jh_journal.jp_journal_magic, jh->jh_journal.jp_journal_magic,
bdevname(journal->j_dev_bd, b), bdevname(journal->j_dev_bd, b),
sb_jp_journal_magic(rs)); sb_jp_journal_magic(rs));
brelse(bhjh); brelse(bhjh);
...@@ -2852,7 +2859,7 @@ int journal_init(struct super_block *p_s_sb, const char *j_dev_name, ...@@ -2852,7 +2859,7 @@ int journal_init(struct super_block *p_s_sb, const char *j_dev_name,
journal->j_must_wait = 0; journal->j_must_wait = 0;
if (journal->j_cnode_free == 0) { if (journal->j_cnode_free == 0) {
reiserfs_warning(p_s_sb, "journal-2004: Journal cnode memory " reiserfs_warning(p_s_sb, "journal-2004", "Journal cnode memory "
"allocation failed (%ld bytes). Journal is " "allocation failed (%ld bytes). Journal is "
"too large for available memory. Usually " "too large for available memory. Usually "
"this is due to a journal that is too large.", "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,12 +2871,13 @@ int journal_init(struct super_block *p_s_sb, const char *j_dev_name,
jl = journal->j_current_jl; jl = journal->j_current_jl;
jl->j_list_bitmap = get_list_bitmap(p_s_sb, jl); jl->j_list_bitmap = get_list_bitmap(p_s_sb, jl);
if (!jl->j_list_bitmap) { if (!jl->j_list_bitmap) {
reiserfs_warning(p_s_sb, reiserfs_warning(p_s_sb, "journal-2005",
"journal-2005, get_list_bitmap failed for journal list 0"); "get_list_bitmap failed for journal list 0");
goto free_and_return; goto free_and_return;
} }
if (journal_read(p_s_sb) < 0) { if (journal_read(p_s_sb) < 0) {
reiserfs_warning(p_s_sb, "Replay Failure, unable to mount"); reiserfs_warning(p_s_sb, "reiserfs-2006",
"Replay Failure, unable to mount");
goto free_and_return; goto free_and_return;
} }
...@@ -3196,16 +3204,17 @@ int journal_begin(struct reiserfs_transaction_handle *th, ...@@ -3196,16 +3204,17 @@ int journal_begin(struct reiserfs_transaction_handle *th,
cur_th->t_refcount++; cur_th->t_refcount++;
memcpy(th, cur_th, sizeof(*th)); memcpy(th, cur_th, sizeof(*th));
if (th->t_refcount <= 1) if (th->t_refcount <= 1)
reiserfs_warning(p_s_sb, reiserfs_warning(p_s_sb, "reiserfs-2005",
"BAD: refcount <= 1, but journal_info != 0"); "BAD: refcount <= 1, but "
"journal_info != 0");
return 0; return 0;
} else { } else {
/* we've ended up with a handle from a different filesystem. /* we've ended up with a handle from a different filesystem.
** save it and restore on journal_end. This should never ** save it and restore on journal_end. This should never
** really happen... ** really happen...
*/ */
reiserfs_warning(p_s_sb, reiserfs_warning(p_s_sb, "clm-2100",
"clm-2100: nesting info a different FS"); "nesting info a different FS");
th->t_handle_save = current->journal_info; th->t_handle_save = current->journal_info;
current->journal_info = th; current->journal_info = th;
} }
...@@ -3266,7 +3275,8 @@ int journal_mark_dirty(struct reiserfs_transaction_handle *th, ...@@ -3266,7 +3275,8 @@ int journal_mark_dirty(struct reiserfs_transaction_handle *th,
** could get to disk too early. NOT GOOD. ** could get to disk too early. NOT GOOD.
*/ */
if (!prepared || buffer_dirty(bh)) { if (!prepared || buffer_dirty(bh)) {
reiserfs_warning(p_s_sb, "journal-1777: buffer %llu bad state " reiserfs_warning(p_s_sb, "journal-1777",
"buffer %llu bad state "
"%cPREPARED %cLOCKED %cDIRTY %cJDIRTY_WAIT", "%cPREPARED %cLOCKED %cDIRTY %cJDIRTY_WAIT",
(unsigned long long)bh->b_blocknr, (unsigned long long)bh->b_blocknr,
prepared ? ' ' : '!', prepared ? ' ' : '!',
...@@ -3276,8 +3286,8 @@ int journal_mark_dirty(struct reiserfs_transaction_handle *th, ...@@ -3276,8 +3286,8 @@ int journal_mark_dirty(struct reiserfs_transaction_handle *th,
} }
if (atomic_read(&(journal->j_wcount)) <= 0) { if (atomic_read(&(journal->j_wcount)) <= 0) {
reiserfs_warning(p_s_sb, reiserfs_warning(p_s_sb, "journal-1409",
"journal-1409: journal_mark_dirty returning because j_wcount was %d", "returning because j_wcount was %d",
atomic_read(&(journal->j_wcount))); atomic_read(&(journal->j_wcount)));
return 1; return 1;
} }
...@@ -3342,8 +3352,8 @@ int journal_end(struct reiserfs_transaction_handle *th, ...@@ -3342,8 +3352,8 @@ int journal_end(struct reiserfs_transaction_handle *th,
struct super_block *p_s_sb, unsigned long nblocks) struct super_block *p_s_sb, unsigned long nblocks)
{ {
if (!current->journal_info && th->t_refcount > 1) if (!current->journal_info && th->t_refcount > 1)
reiserfs_warning(p_s_sb, "REISER-NESTING: th NULL, refcount %d", reiserfs_warning(p_s_sb, "REISER-NESTING",
th->t_refcount); "th NULL, refcount %d", th->t_refcount);
if (!th->t_trans_id) { if (!th->t_trans_id) {
WARN_ON(1); WARN_ON(1);
...@@ -3413,8 +3423,8 @@ static int remove_from_transaction(struct super_block *p_s_sb, ...@@ -3413,8 +3423,8 @@ static int remove_from_transaction(struct super_block *p_s_sb,
clear_buffer_journal_test(bh); clear_buffer_journal_test(bh);
put_bh(bh); put_bh(bh);
if (atomic_read(&(bh->b_count)) < 0) { if (atomic_read(&(bh->b_count)) < 0) {
reiserfs_warning(p_s_sb, reiserfs_warning(p_s_sb, "journal-1752",
"journal-1752: remove from trans, b_count < 0"); "b_count < 0");
} }
ret = 1; ret = 1;
} }
...@@ -3734,7 +3744,8 @@ int journal_mark_freed(struct reiserfs_transaction_handle *th, ...@@ -3734,7 +3744,8 @@ int journal_mark_freed(struct reiserfs_transaction_handle *th,
if (atomic_read if (atomic_read
(&(cn->bh->b_count)) < 0) { (&(cn->bh->b_count)) < 0) {
reiserfs_warning(p_s_sb, reiserfs_warning(p_s_sb,
"journal-2138: cn->bh->b_count < 0"); "journal-2138",
"cn->bh->b_count < 0");
} }
} }
if (cn->jlist) { /* since we are clearing the bh, we MUST dec nonzerolen */ 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,8 +4148,9 @@ static int do_journal_end(struct reiserfs_transaction_handle *th,
clear_buffer_journaled(cn->bh); clear_buffer_journaled(cn->bh);
} else { } else {
/* JDirty cleared sometime during transaction. don't log this one */ /* JDirty cleared sometime during transaction. don't log this one */
reiserfs_warning(p_s_sb, reiserfs_warning(p_s_sb, "journal-2048",
"journal-2048: do_journal_end: BAD, buffer in journal hash, but not JDirty!"); "BAD, buffer in journal hash, "
"but not JDirty!");
brelse(cn->bh); brelse(cn->bh);
} }
next = cn->next; next = cn->next;
......
...@@ -1288,12 +1288,16 @@ void leaf_paste_entries(struct buffer_info *bi, ...@@ -1288,12 +1288,16 @@ void leaf_paste_entries(struct buffer_info *bi,
prev = (i != 0) ? deh_location(&(deh[i - 1])) : 0; prev = (i != 0) ? deh_location(&(deh[i - 1])) : 0;
if (prev && prev <= deh_location(&(deh[i]))) if (prev && prev <= deh_location(&(deh[i])))
reiserfs_warning(NULL, reiserfs_warning(NULL, "vs-10240",
"vs-10240: leaf_paste_entries: directory item (%h) corrupted (prev %a, cur(%d) %a)", "directory item (%h) "
"corrupted (prev %a, "
"cur(%d) %a)",
ih, deh + i - 1, i, deh + i); ih, deh + i - 1, i, deh + i);
if (next && next >= deh_location(&(deh[i]))) if (next && next >= deh_location(&(deh[i])))
reiserfs_warning(NULL, reiserfs_warning(NULL, "vs-10250",
"vs-10250: leaf_paste_entries: directory item (%h) corrupted (cur(%d) %a, next %a)", "directory item (%h) "
"corrupted (cur(%d) %a, "
"next %a)",
ih, i, deh + i, deh + i + 1); ih, i, deh + i, deh + i + 1);
} }
} }
......
...@@ -120,8 +120,8 @@ int search_by_entry_key(struct super_block *sb, const struct cpu_key *key, ...@@ -120,8 +120,8 @@ int search_by_entry_key(struct super_block *sb, const struct cpu_key *key,
switch (retval) { switch (retval) {
case ITEM_NOT_FOUND: case ITEM_NOT_FOUND:
if (!PATH_LAST_POSITION(path)) { if (!PATH_LAST_POSITION(path)) {
reiserfs_warning(sb, reiserfs_warning(sb, "vs-7000", "search_by_key "
"vs-7000: search_by_entry_key: search_by_key returned item position == 0"); "returned item position == 0");
pathrelse(path); pathrelse(path);
return IO_ERROR; return IO_ERROR;
} }
...@@ -135,8 +135,7 @@ int search_by_entry_key(struct super_block *sb, const struct cpu_key *key, ...@@ -135,8 +135,7 @@ int search_by_entry_key(struct super_block *sb, const struct cpu_key *key,
default: default:
pathrelse(path); pathrelse(path);
reiserfs_warning(sb, reiserfs_warning(sb, "vs-7002", "no path to here");
"vs-7002: search_by_entry_key: no path to here");
return IO_ERROR; return IO_ERROR;
} }
...@@ -300,8 +299,7 @@ static int reiserfs_find_entry(struct inode *dir, const char *name, int namelen, ...@@ -300,8 +299,7 @@ static int reiserfs_find_entry(struct inode *dir, const char *name, int namelen,
search_by_entry_key(dir->i_sb, &key_to_search, search_by_entry_key(dir->i_sb, &key_to_search,
path_to_entry, de); path_to_entry, de);
if (retval == IO_ERROR) { if (retval == IO_ERROR) {
reiserfs_warning(dir->i_sb, "zam-7001: io error in %s", reiserfs_warning(dir->i_sb, "zam-7001", "io error");
__func__);
return IO_ERROR; return IO_ERROR;
} }
...@@ -484,10 +482,9 @@ static int reiserfs_add_entry(struct reiserfs_transaction_handle *th, ...@@ -484,10 +482,9 @@ static int reiserfs_add_entry(struct reiserfs_transaction_handle *th,
} }
if (retval != NAME_FOUND) { if (retval != NAME_FOUND) {
reiserfs_warning(dir->i_sb, reiserfs_warning(dir->i_sb, "zam-7002",
"zam-7002:%s: \"reiserfs_find_entry\" " "reiserfs_find_entry() returned "
"has returned unexpected value (%d)", "unexpected value (%d)", retval);
__func__, retval);
} }
return -EEXIST; return -EEXIST;
...@@ -498,8 +495,9 @@ static int reiserfs_add_entry(struct reiserfs_transaction_handle *th, ...@@ -498,8 +495,9 @@ static int reiserfs_add_entry(struct reiserfs_transaction_handle *th,
MAX_GENERATION_NUMBER + 1); MAX_GENERATION_NUMBER + 1);
if (gen_number > MAX_GENERATION_NUMBER) { if (gen_number > MAX_GENERATION_NUMBER) {
/* there is no free generation number */ /* there is no free generation number */
reiserfs_warning(dir->i_sb, reiserfs_warning(dir->i_sb, "reiserfs-7010",
"reiserfs_add_entry: Congratulations! we have got hash function screwed up"); "Congratulations! we have got hash function "
"screwed up");
if (buffer != small_buf) if (buffer != small_buf)
kfree(buffer); kfree(buffer);
pathrelse(&path); pathrelse(&path);
...@@ -515,10 +513,9 @@ static int reiserfs_add_entry(struct reiserfs_transaction_handle *th, ...@@ -515,10 +513,9 @@ static int reiserfs_add_entry(struct reiserfs_transaction_handle *th,
if (gen_number != 0) { /* we need to re-search for the insertion point */ if (gen_number != 0) { /* we need to re-search for the insertion point */
if (search_by_entry_key(dir->i_sb, &entry_key, &path, &de) != if (search_by_entry_key(dir->i_sb, &entry_key, &path, &de) !=
NAME_NOT_FOUND) { NAME_NOT_FOUND) {
reiserfs_warning(dir->i_sb, reiserfs_warning(dir->i_sb, "vs-7032",
"vs-7032: reiserfs_add_entry: " "entry with this key (%K) already "
"entry with this key (%K) already exists", "exists", &entry_key);
&entry_key);
if (buffer != small_buf) if (buffer != small_buf)
kfree(buffer); kfree(buffer);
...@@ -903,8 +900,9 @@ static int reiserfs_rmdir(struct inode *dir, struct dentry *dentry) ...@@ -903,8 +900,9 @@ static int reiserfs_rmdir(struct inode *dir, struct dentry *dentry)
goto end_rmdir; goto end_rmdir;
if (inode->i_nlink != 2 && inode->i_nlink != 1) if (inode->i_nlink != 2 && inode->i_nlink != 1)
reiserfs_warning(inode->i_sb, "%s: empty directory has nlink " reiserfs_warning(inode->i_sb, "reiserfs-7040",
"!= 2 (%d)", __func__, inode->i_nlink); "empty directory has nlink != 2 (%d)",
inode->i_nlink);
clear_nlink(inode); clear_nlink(inode);
inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME_SEC; 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,10 +978,9 @@ static int reiserfs_unlink(struct inode *dir, struct dentry *dentry)
} }
if (!inode->i_nlink) { if (!inode->i_nlink) {
reiserfs_warning(inode->i_sb, "%s: deleting nonexistent file " reiserfs_warning(inode->i_sb, "reiserfs-7042",
"(%s:%lu), %d", __func__, "deleting nonexistent file (%lu), %d",
reiserfs_bdevname(inode->i_sb), inode->i_ino, inode->i_ino, inode->i_nlink);
inode->i_nlink);
inode->i_nlink = 1; inode->i_nlink = 1;
} }
...@@ -1499,8 +1496,8 @@ static int reiserfs_rename(struct inode *old_dir, struct dentry *old_dentry, ...@@ -1499,8 +1496,8 @@ static int reiserfs_rename(struct inode *old_dir, struct dentry *old_dentry,
if (reiserfs_cut_from_item if (reiserfs_cut_from_item
(&th, &old_entry_path, &(old_de.de_entry_key), old_dir, NULL, (&th, &old_entry_path, &(old_de.de_entry_key), old_dir, NULL,
0) < 0) 0) < 0)
reiserfs_warning(old_dir->i_sb, reiserfs_warning(old_dir->i_sb, "vs-7060",
"vs-7060: reiserfs_rename: couldn't not cut old name. Fsck later?"); "couldn't not cut old name. Fsck later?");
old_dir->i_size -= DEH_SIZE + old_de.de_entrylen; old_dir->i_size -= DEH_SIZE + old_de.de_entrylen;
......
...@@ -61,7 +61,7 @@ __u32 reiserfs_get_unused_objectid(struct reiserfs_transaction_handle *th) ...@@ -61,7 +61,7 @@ __u32 reiserfs_get_unused_objectid(struct reiserfs_transaction_handle *th)
/* comment needed -Hans */ /* comment needed -Hans */
unused_objectid = le32_to_cpu(map[1]); unused_objectid = le32_to_cpu(map[1]);
if (unused_objectid == U32_MAX) { if (unused_objectid == U32_MAX) {
reiserfs_warning(s, "%s: no more object ids", __func__); reiserfs_warning(s, "reiserfs-15100", "no more object ids");
reiserfs_restore_prepared_buffer(s, SB_BUFFER_WITH_SB(s)); reiserfs_restore_prepared_buffer(s, SB_BUFFER_WITH_SB(s));
return 0; return 0;
} }
...@@ -160,8 +160,7 @@ void reiserfs_release_objectid(struct reiserfs_transaction_handle *th, ...@@ -160,8 +160,7 @@ void reiserfs_release_objectid(struct reiserfs_transaction_handle *th,
i += 2; i += 2;
} }
reiserfs_warning(s, reiserfs_warning(s, "vs-15011", "tried to free free object id (%lu)",
"vs-15011: reiserfs_release_objectid: tried to free free object id (%lu)",
(long unsigned)objectid_to_release); (long unsigned)objectid_to_release);
} }
......
...@@ -264,14 +264,17 @@ static void prepare_error_buf(const char *fmt, va_list args) ...@@ -264,14 +264,17 @@ static void prepare_error_buf(const char *fmt, va_list args)
va_end( args );\ va_end( args );\
} }
void reiserfs_warning(struct super_block *sb, const char *fmt, ...) void __reiserfs_warning(struct super_block *sb, const char *id,
const char *function, const char *fmt, ...)
{ {
do_reiserfs_warning(fmt); do_reiserfs_warning(fmt);
if (sb) if (sb)
printk(KERN_WARNING "REISERFS warning (device %s): %s\n", printk(KERN_WARNING "REISERFS warning (device %s): %s%s%s: "
sb->s_id, error_buf); "%s\n", sb->s_id, id ? id : "", id ? " " : "",
function, error_buf);
else else
printk(KERN_WARNING "REISERFS warning: %s\n", error_buf); printk(KERN_WARNING "REISERFS warning: %s%s%s: %s\n",
id ? id : "", id ? " " : "", function, error_buf);
} }
/* No newline.. reiserfs_info calls can be followed by printk's */ /* No newline.. reiserfs_info calls can be followed by printk's */
......
...@@ -503,7 +503,7 @@ int reiserfs_proc_info_init(struct super_block *sb) ...@@ -503,7 +503,7 @@ int reiserfs_proc_info_init(struct super_block *sb)
add_file(sb, "journal", show_journal); add_file(sb, "journal", show_journal);
return 0; return 0;
} }
reiserfs_warning(sb, "reiserfs: cannot create /proc/%s/%s", reiserfs_warning(sb, "cannot create /proc/%s/%s",
proc_info_root_name, b); proc_info_root_name, b);
return 1; return 1;
} }
...@@ -559,8 +559,7 @@ int reiserfs_proc_info_global_init(void) ...@@ -559,8 +559,7 @@ int reiserfs_proc_info_global_init(void)
if (proc_info_root) { if (proc_info_root) {
proc_info_root->owner = THIS_MODULE; proc_info_root->owner = THIS_MODULE;
} else { } else {
reiserfs_warning(NULL, reiserfs_warning(NULL, "cannot create /proc/%s",
"reiserfs: cannot create /proc/%s",
proc_info_root_name); proc_info_root_name);
return 1; return 1;
} }
......
...@@ -444,23 +444,24 @@ static int is_leaf(char *buf, int blocksize, struct buffer_head *bh) ...@@ -444,23 +444,24 @@ static int is_leaf(char *buf, int blocksize, struct buffer_head *bh)
blkh = (struct block_head *)buf; blkh = (struct block_head *)buf;
if (blkh_level(blkh) != DISK_LEAF_NODE_LEVEL) { if (blkh_level(blkh) != DISK_LEAF_NODE_LEVEL) {
reiserfs_warning(NULL, reiserfs_warning(NULL, "reiserfs-5080",
"is_leaf: this should be caught earlier"); "this should be caught earlier");
return 0; return 0;
} }
nr = blkh_nr_item(blkh); nr = blkh_nr_item(blkh);
if (nr < 1 || nr > ((blocksize - BLKH_SIZE) / (IH_SIZE + MIN_ITEM_LEN))) { if (nr < 1 || nr > ((blocksize - BLKH_SIZE) / (IH_SIZE + MIN_ITEM_LEN))) {
/* item number is too big or too small */ /* item number is too big or too small */
reiserfs_warning(NULL, "is_leaf: nr_item seems wrong: %z", bh); reiserfs_warning(NULL, "reiserfs-5081",
"nr_item seems wrong: %z", bh);
return 0; return 0;
} }
ih = (struct item_head *)(buf + BLKH_SIZE) + nr - 1; ih = (struct item_head *)(buf + BLKH_SIZE) + nr - 1;
used_space = BLKH_SIZE + IH_SIZE * nr + (blocksize - ih_location(ih)); used_space = BLKH_SIZE + IH_SIZE * nr + (blocksize - ih_location(ih));
if (used_space != blocksize - blkh_free_space(blkh)) { if (used_space != blocksize - blkh_free_space(blkh)) {
/* free space does not match to calculated amount of use space */ /* free space does not match to calculated amount of use space */
reiserfs_warning(NULL, "is_leaf: free space seems wrong: %z", reiserfs_warning(NULL, "reiserfs-5082",
bh); "free space seems wrong: %z", bh);
return 0; return 0;
} }
// FIXME: it is_leaf will hit performance too much - we may have // 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,29 +472,29 @@ static int is_leaf(char *buf, int blocksize, struct buffer_head *bh)
prev_location = blocksize; prev_location = blocksize;
for (i = 0; i < nr; i++, ih++) { for (i = 0; i < nr; i++, ih++) {
if (le_ih_k_type(ih) == TYPE_ANY) { if (le_ih_k_type(ih) == TYPE_ANY) {
reiserfs_warning(NULL, reiserfs_warning(NULL, "reiserfs-5083",
"is_leaf: wrong item type for item %h", "wrong item type for item %h",
ih); ih);
return 0; return 0;
} }
if (ih_location(ih) >= blocksize if (ih_location(ih) >= blocksize
|| ih_location(ih) < IH_SIZE * nr) { || ih_location(ih) < IH_SIZE * nr) {
reiserfs_warning(NULL, reiserfs_warning(NULL, "reiserfs-5084",
"is_leaf: item location seems wrong: %h", "item location seems wrong: %h",
ih); ih);
return 0; return 0;
} }
if (ih_item_len(ih) < 1 if (ih_item_len(ih) < 1
|| ih_item_len(ih) > MAX_ITEM_LEN(blocksize)) { || ih_item_len(ih) > MAX_ITEM_LEN(blocksize)) {
reiserfs_warning(NULL, reiserfs_warning(NULL, "reiserfs-5085",
"is_leaf: item length seems wrong: %h", "item length seems wrong: %h",
ih); ih);
return 0; return 0;
} }
if (prev_location - ih_location(ih) != ih_item_len(ih)) { if (prev_location - ih_location(ih) != ih_item_len(ih)) {
reiserfs_warning(NULL, reiserfs_warning(NULL, "reiserfs-5086",
"is_leaf: item location seems wrong (second one): %h", "item location seems wrong "
ih); "(second one): %h", ih);
return 0; return 0;
} }
prev_location = ih_location(ih); prev_location = ih_location(ih);
...@@ -514,24 +515,23 @@ static int is_internal(char *buf, int blocksize, struct buffer_head *bh) ...@@ -514,24 +515,23 @@ static int is_internal(char *buf, int blocksize, struct buffer_head *bh)
nr = blkh_level(blkh); nr = blkh_level(blkh);
if (nr <= DISK_LEAF_NODE_LEVEL || nr > MAX_HEIGHT) { if (nr <= DISK_LEAF_NODE_LEVEL || nr > MAX_HEIGHT) {
/* this level is not possible for internal nodes */ /* this level is not possible for internal nodes */
reiserfs_warning(NULL, reiserfs_warning(NULL, "reiserfs-5087",
"is_internal: this should be caught earlier"); "this should be caught earlier");
return 0; return 0;
} }
nr = blkh_nr_item(blkh); nr = blkh_nr_item(blkh);
if (nr > (blocksize - BLKH_SIZE - DC_SIZE) / (KEY_SIZE + DC_SIZE)) { if (nr > (blocksize - BLKH_SIZE - DC_SIZE) / (KEY_SIZE + DC_SIZE)) {
/* for internal which is not root we might check min number of keys */ /* for internal which is not root we might check min number of keys */
reiserfs_warning(NULL, reiserfs_warning(NULL, "reiserfs-5088",
"is_internal: number of key seems wrong: %z", "number of key seems wrong: %z", bh);
bh);
return 0; return 0;
} }
used_space = BLKH_SIZE + KEY_SIZE * nr + DC_SIZE * (nr + 1); used_space = BLKH_SIZE + KEY_SIZE * nr + DC_SIZE * (nr + 1);
if (used_space != blocksize - blkh_free_space(blkh)) { if (used_space != blocksize - blkh_free_space(blkh)) {
reiserfs_warning(NULL, reiserfs_warning(NULL, "reiserfs-5089",
"is_internal: free space seems wrong: %z", bh); "free space seems wrong: %z", bh);
return 0; return 0;
} }
// one may imagine much more checks // one may imagine much more checks
...@@ -543,8 +543,8 @@ static int is_internal(char *buf, int blocksize, struct buffer_head *bh) ...@@ -543,8 +543,8 @@ static int is_internal(char *buf, int blocksize, struct buffer_head *bh)
static int is_tree_node(struct buffer_head *bh, int level) static int is_tree_node(struct buffer_head *bh, int level)
{ {
if (B_LEVEL(bh) != level) { if (B_LEVEL(bh) != level) {
reiserfs_warning(NULL, reiserfs_warning(NULL, "reiserfs-5090", "node level %d does "
"is_tree_node: node level %d does not match to the expected one %d", "not match to the expected one %d",
B_LEVEL(bh), level); B_LEVEL(bh), level);
return 0; return 0;
} }
...@@ -645,9 +645,9 @@ int search_by_key(struct super_block *p_s_sb, const struct cpu_key *p_s_key, /* ...@@ -645,9 +645,9 @@ int search_by_key(struct super_block *p_s_sb, const struct cpu_key *p_s_key, /*
#ifdef CONFIG_REISERFS_CHECK #ifdef CONFIG_REISERFS_CHECK
if (!(++n_repeat_counter % 50000)) if (!(++n_repeat_counter % 50000))
reiserfs_warning(p_s_sb, "PAP-5100: search_by_key: %s:" reiserfs_warning(p_s_sb, "PAP-5100",
"there were %d iterations of while loop " "%s: there were %d iterations of "
"looking for key %K", "while loop looking for key %K",
current->comm, n_repeat_counter, current->comm, n_repeat_counter,
p_s_key); p_s_key);
#endif #endif
...@@ -721,9 +721,9 @@ int search_by_key(struct super_block *p_s_sb, const struct cpu_key *p_s_key, /* ...@@ -721,9 +721,9 @@ int search_by_key(struct super_block *p_s_sb, const struct cpu_key *p_s_key, /*
// make sure, that the node contents look like a node of // make sure, that the node contents look like a node of
// certain level // certain level
if (!is_tree_node(p_s_bh, expected_level)) { if (!is_tree_node(p_s_bh, expected_level)) {
reiserfs_warning(p_s_sb, "vs-5150: search_by_key: " reiserfs_warning(p_s_sb, "vs-5150",
"invalid format found in block %ld. Fsck?", "invalid format found in block %ld. "
p_s_bh->b_blocknr); "Fsck?", p_s_bh->b_blocknr);
pathrelse(p_s_search_path); pathrelse(p_s_search_path);
return IO_ERROR; return IO_ERROR;
} }
...@@ -1227,8 +1227,7 @@ int reiserfs_delete_item(struct reiserfs_transaction_handle *th, struct treepath ...@@ -1227,8 +1227,7 @@ int reiserfs_delete_item(struct reiserfs_transaction_handle *th, struct treepath
if (n_ret_value == IO_ERROR) if (n_ret_value == IO_ERROR)
break; break;
if (n_ret_value == FILE_NOT_FOUND) { if (n_ret_value == FILE_NOT_FOUND) {
reiserfs_warning(p_s_sb, reiserfs_warning(p_s_sb, "vs-5340",
"vs-5340: reiserfs_delete_item: "
"no items of the file %K found", "no items of the file %K found",
p_s_item_key); p_s_item_key);
break; break;
...@@ -1338,10 +1337,9 @@ void reiserfs_delete_solid_item(struct reiserfs_transaction_handle *th, ...@@ -1338,10 +1337,9 @@ void reiserfs_delete_solid_item(struct reiserfs_transaction_handle *th,
while (1) { while (1) {
retval = search_item(th->t_super, &cpu_key, &path); retval = search_item(th->t_super, &cpu_key, &path);
if (retval == IO_ERROR) { if (retval == IO_ERROR) {
reiserfs_warning(th->t_super, reiserfs_warning(th->t_super, "vs-5350",
"vs-5350: reiserfs_delete_solid_item: " "i/o failure occurred trying "
"i/o failure occurred trying to delete %K", "to delete %K", &cpu_key);
&cpu_key);
break; break;
} }
if (retval != ITEM_FOUND) { if (retval != ITEM_FOUND) {
...@@ -1355,9 +1353,8 @@ void reiserfs_delete_solid_item(struct reiserfs_transaction_handle *th, ...@@ -1355,9 +1353,8 @@ void reiserfs_delete_solid_item(struct reiserfs_transaction_handle *th,
GET_GENERATION_NUMBER(le_key_k_offset GET_GENERATION_NUMBER(le_key_k_offset
(le_key_version(key), (le_key_version(key),
key)) == 1)) key)) == 1))
reiserfs_warning(th->t_super, reiserfs_warning(th->t_super, "vs-5355",
"vs-5355: reiserfs_delete_solid_item: %k not found", "%k not found", key);
key);
break; break;
} }
if (!tb_init) { if (!tb_init) {
...@@ -1389,8 +1386,7 @@ void reiserfs_delete_solid_item(struct reiserfs_transaction_handle *th, ...@@ -1389,8 +1386,7 @@ void reiserfs_delete_solid_item(struct reiserfs_transaction_handle *th,
break; break;
} }
// IO_ERROR, NO_DISK_SPACE, etc // IO_ERROR, NO_DISK_SPACE, etc
reiserfs_warning(th->t_super, reiserfs_warning(th->t_super, "vs-5360",
"vs-5360: reiserfs_delete_solid_item: "
"could not delete %K due to fix_nodes failure", "could not delete %K due to fix_nodes failure",
&cpu_key); &cpu_key);
unfix_nodes(&tb); unfix_nodes(&tb);
...@@ -1533,8 +1529,9 @@ static void indirect_to_direct_roll_back(struct reiserfs_transaction_handle *th, ...@@ -1533,8 +1529,9 @@ static void indirect_to_direct_roll_back(struct reiserfs_transaction_handle *th,
set_cpu_key_k_offset(&tail_key, set_cpu_key_k_offset(&tail_key,
cpu_key_k_offset(&tail_key) - removed); cpu_key_k_offset(&tail_key) - removed);
} }
reiserfs_warning(inode->i_sb, reiserfs_warning(inode->i_sb, "reiserfs-5091", "indirect_to_direct "
"indirect_to_direct_roll_back: indirect_to_direct conversion has been rolled back due to lack of disk space"); "conversion has been rolled back due to "
"lack of disk space");
//mark_file_without_tail (inode); //mark_file_without_tail (inode);
mark_inode_dirty(inode); mark_inode_dirty(inode);
} }
...@@ -1639,8 +1636,7 @@ int reiserfs_cut_from_item(struct reiserfs_transaction_handle *th, ...@@ -1639,8 +1636,7 @@ int reiserfs_cut_from_item(struct reiserfs_transaction_handle *th,
if (n_ret_value == POSITION_FOUND) if (n_ret_value == POSITION_FOUND)
continue; continue;
reiserfs_warning(p_s_sb, reiserfs_warning(p_s_sb, "PAP-5610", "item %K not found",
"PAP-5610: reiserfs_cut_from_item: item %K not found",
p_s_item_key); p_s_item_key);
unfix_nodes(&s_cut_balance); unfix_nodes(&s_cut_balance);
return (n_ret_value == IO_ERROR) ? -EIO : -ENOENT; return (n_ret_value == IO_ERROR) ? -EIO : -ENOENT;
...@@ -1654,7 +1650,8 @@ int reiserfs_cut_from_item(struct reiserfs_transaction_handle *th, ...@@ -1654,7 +1650,8 @@ int reiserfs_cut_from_item(struct reiserfs_transaction_handle *th,
indirect_to_direct_roll_back(th, p_s_inode, p_s_path); indirect_to_direct_roll_back(th, p_s_inode, p_s_path);
} }
if (n_ret_value == NO_DISK_SPACE) if (n_ret_value == NO_DISK_SPACE)
reiserfs_warning(p_s_sb, "NO_DISK_SPACE"); reiserfs_warning(p_s_sb, "reiserfs-5092",
"NO_DISK_SPACE");
unfix_nodes(&s_cut_balance); unfix_nodes(&s_cut_balance);
return -EIO; return -EIO;
} }
...@@ -1743,8 +1740,7 @@ static void truncate_directory(struct reiserfs_transaction_handle *th, ...@@ -1743,8 +1740,7 @@ static void truncate_directory(struct reiserfs_transaction_handle *th,
{ {
BUG_ON(!th->t_trans_id); BUG_ON(!th->t_trans_id);
if (inode->i_nlink) if (inode->i_nlink)
reiserfs_warning(inode->i_sb, reiserfs_warning(inode->i_sb, "vs-5655", "link count != 0");
"vs-5655: truncate_directory: link count != 0");
set_le_key_k_offset(KEY_FORMAT_3_5, INODE_PKEY(inode), DOT_OFFSET); set_le_key_k_offset(KEY_FORMAT_3_5, INODE_PKEY(inode), DOT_OFFSET);
set_le_key_k_type(KEY_FORMAT_3_5, INODE_PKEY(inode), TYPE_DIRENTRY); 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,16 +1793,14 @@ int reiserfs_do_truncate(struct reiserfs_transaction_handle *th, struct inode *p
search_for_position_by_key(p_s_inode->i_sb, &s_item_key, search_for_position_by_key(p_s_inode->i_sb, &s_item_key,
&s_search_path); &s_search_path);
if (retval == IO_ERROR) { if (retval == IO_ERROR) {
reiserfs_warning(p_s_inode->i_sb, reiserfs_warning(p_s_inode->i_sb, "vs-5657",
"vs-5657: reiserfs_do_truncate: "
"i/o failure occurred trying to truncate %K", "i/o failure occurred trying to truncate %K",
&s_item_key); &s_item_key);
err = -EIO; err = -EIO;
goto out; goto out;
} }
if (retval == POSITION_FOUND || retval == FILE_NOT_FOUND) { if (retval == POSITION_FOUND || retval == FILE_NOT_FOUND) {
reiserfs_warning(p_s_inode->i_sb, reiserfs_warning(p_s_inode->i_sb, "PAP-5660",
"PAP-5660: reiserfs_do_truncate: "
"wrong result %d of search for %K", retval, "wrong result %d of search for %K", retval,
&s_item_key); &s_item_key);
...@@ -1850,8 +1844,8 @@ int reiserfs_do_truncate(struct reiserfs_transaction_handle *th, struct inode *p ...@@ -1850,8 +1844,8 @@ int reiserfs_do_truncate(struct reiserfs_transaction_handle *th, struct inode *p
reiserfs_cut_from_item(th, &s_search_path, &s_item_key, reiserfs_cut_from_item(th, &s_search_path, &s_item_key,
p_s_inode, page, n_new_file_size); p_s_inode, page, n_new_file_size);
if (n_deleted < 0) { if (n_deleted < 0) {
reiserfs_warning(p_s_inode->i_sb, reiserfs_warning(p_s_inode->i_sb, "vs-5665",
"vs-5665: reiserfs_do_truncate: reiserfs_cut_from_item failed"); "reiserfs_cut_from_item failed");
reiserfs_check_path(&s_search_path); reiserfs_check_path(&s_search_path);
return 0; return 0;
} }
...@@ -2000,8 +1994,8 @@ int reiserfs_paste_into_item(struct reiserfs_transaction_handle *th, struct tree ...@@ -2000,8 +1994,8 @@ int reiserfs_paste_into_item(struct reiserfs_transaction_handle *th, struct tree
goto error_out; goto error_out;
} }
if (retval == POSITION_FOUND) { if (retval == POSITION_FOUND) {
reiserfs_warning(inode->i_sb, reiserfs_warning(inode->i_sb, "PAP-5710",
"PAP-5710: reiserfs_paste_into_item: entry or pasted byte (%K) exists", "entry or pasted byte (%K) exists",
p_s_key); p_s_key);
retval = -EEXIST; retval = -EEXIST;
goto error_out; goto error_out;
...@@ -2087,8 +2081,7 @@ int reiserfs_insert_item(struct reiserfs_transaction_handle *th, struct treepath ...@@ -2087,8 +2081,7 @@ int reiserfs_insert_item(struct reiserfs_transaction_handle *th, struct treepath
goto error_out; goto error_out;
} }
if (retval == ITEM_FOUND) { if (retval == ITEM_FOUND) {
reiserfs_warning(th->t_super, reiserfs_warning(th->t_super, "PAP-5760",
"PAP-5760: reiserfs_insert_item: "
"key %K already exists in the tree", "key %K already exists in the tree",
key); key);
retval = -EEXIST; retval = -EEXIST;
......
此差异已折叠。
...@@ -48,9 +48,9 @@ int direct2indirect(struct reiserfs_transaction_handle *th, struct inode *inode, ...@@ -48,9 +48,9 @@ int direct2indirect(struct reiserfs_transaction_handle *th, struct inode *inode,
// FIXME: we could avoid this // FIXME: we could avoid this
if (search_for_position_by_key(sb, &end_key, path) == POSITION_FOUND) { if (search_for_position_by_key(sb, &end_key, path) == POSITION_FOUND) {
reiserfs_warning(sb, "PAP-14030: direct2indirect: " reiserfs_warning(sb, "PAP-14030",
"pasted or inserted byte exists in the tree %K. " "pasted or inserted byte exists in "
"Use fsck to repair.", &end_key); "the tree %K. Use fsck to repair.", &end_key);
pathrelse(path); pathrelse(path);
return -EIO; return -EIO;
} }
......
...@@ -259,7 +259,8 @@ static int __xattr_readdir(struct inode *inode, void *dirent, filldir_t filldir) ...@@ -259,7 +259,8 @@ static int __xattr_readdir(struct inode *inode, void *dirent, filldir_t filldir)
ih = de.de_ih; ih = de.de_ih;
if (!is_direntry_le_ih(ih)) { if (!is_direntry_le_ih(ih)) {
reiserfs_warning(inode->i_sb, "not direntry %h", ih); reiserfs_warning(inode->i_sb, "jdm-20000",
"not direntry %h", ih);
break; break;
} }
copy_item_head(&tmp_ih, ih); copy_item_head(&tmp_ih, ih);
...@@ -598,7 +599,7 @@ reiserfs_xattr_get(const struct inode *inode, const char *name, void *buffer, ...@@ -598,7 +599,7 @@ reiserfs_xattr_get(const struct inode *inode, const char *name, void *buffer,
if (rxh->h_magic != cpu_to_le32(REISERFS_XATTR_MAGIC)) { if (rxh->h_magic != cpu_to_le32(REISERFS_XATTR_MAGIC)) {
unlock_page(page); unlock_page(page);
reiserfs_put_page(page); reiserfs_put_page(page);
reiserfs_warning(inode->i_sb, reiserfs_warning(inode->i_sb, "jdm-20001",
"Invalid magic for xattr (%s) " "Invalid magic for xattr (%s) "
"associated with %k", name, "associated with %k", name,
INODE_PKEY(inode)); INODE_PKEY(inode));
...@@ -618,7 +619,7 @@ reiserfs_xattr_get(const struct inode *inode, const char *name, void *buffer, ...@@ -618,7 +619,7 @@ reiserfs_xattr_get(const struct inode *inode, const char *name, void *buffer,
if (xattr_hash(buffer, isize - sizeof(struct reiserfs_xattr_header)) != if (xattr_hash(buffer, isize - sizeof(struct reiserfs_xattr_header)) !=
hash) { hash) {
reiserfs_warning(inode->i_sb, reiserfs_warning(inode->i_sb, "jdm-20002",
"Invalid hash for xattr (%s) associated " "Invalid hash for xattr (%s) associated "
"with %k", name, INODE_PKEY(inode)); "with %k", name, INODE_PKEY(inode));
err = -EIO; err = -EIO;
...@@ -652,7 +653,8 @@ __reiserfs_xattr_del(struct dentry *xadir, const char *name, int namelen) ...@@ -652,7 +653,8 @@ __reiserfs_xattr_del(struct dentry *xadir, const char *name, int namelen)
goto out_file; goto out_file;
if (!is_reiserfs_priv_object(dentry->d_inode)) { if (!is_reiserfs_priv_object(dentry->d_inode)) {
reiserfs_warning(dir->i_sb, "OID %08x [%.*s/%.*s] doesn't have " reiserfs_warning(dir->i_sb, "jdm-20003",
"OID %08x [%.*s/%.*s] doesn't have "
"priv flag set [parent is %sset].", "priv flag set [parent is %sset].",
le32_to_cpu(INODE_PKEY(dentry->d_inode)-> le32_to_cpu(INODE_PKEY(dentry->d_inode)->
k_objectid), xadir->d_name.len, k_objectid), xadir->d_name.len,
...@@ -750,7 +752,7 @@ int reiserfs_delete_xattrs(struct inode *inode) ...@@ -750,7 +752,7 @@ int reiserfs_delete_xattrs(struct inode *inode)
reiserfs_write_unlock_xattrs(inode->i_sb); reiserfs_write_unlock_xattrs(inode->i_sb);
dput(root); dput(root);
} else { } else {
reiserfs_warning(inode->i_sb, reiserfs_warning(inode->i_sb, "jdm-20006",
"Couldn't remove all entries in directory"); "Couldn't remove all entries in directory");
} }
unlock_kernel(); unlock_kernel();
...@@ -1154,7 +1156,8 @@ int reiserfs_xattr_init(struct super_block *s, int mount_flags) ...@@ -1154,7 +1156,8 @@ int reiserfs_xattr_init(struct super_block *s, int mount_flags)
} else if (reiserfs_xattrs_optional(s)) { } else if (reiserfs_xattrs_optional(s)) {
/* Old format filesystem, but optional xattrs have been enabled /* Old format filesystem, but optional xattrs have been enabled
* at mount time. Error out. */ * at mount time. Error out. */
reiserfs_warning(s, "xattrs/ACLs not supported on pre v3.6 " reiserfs_warning(s, "jdm-20005",
"xattrs/ACLs not supported on pre v3.6 "
"format filesystem. Failing mount."); "format filesystem. Failing mount.");
err = -EOPNOTSUPP; err = -EOPNOTSUPP;
goto error; goto error;
...@@ -1201,8 +1204,10 @@ int reiserfs_xattr_init(struct super_block *s, int mount_flags) ...@@ -1201,8 +1204,10 @@ int reiserfs_xattr_init(struct super_block *s, int mount_flags)
/* If we're read-only it just means that the dir hasn't been /* If we're read-only it just means that the dir hasn't been
* created. Not an error -- just no xattrs on the fs. We'll * created. Not an error -- just no xattrs on the fs. We'll
* check again if we go read-write */ * check again if we go read-write */
reiserfs_warning(s, "xattrs/ACLs enabled and couldn't " reiserfs_warning(s, "jdm-20006",
"find/create .reiserfs_priv. Failing mount."); "xattrs/ACLs enabled and couldn't "
"find/create .reiserfs_priv. "
"Failing mount.");
err = -EOPNOTSUPP; err = -EOPNOTSUPP;
} }
} }
......
...@@ -79,7 +79,10 @@ struct fid; ...@@ -79,7 +79,10 @@ struct fid;
*/ */
#define REISERFS_DEBUG_CODE 5 /* extra messages to help find/debug errors */ #define REISERFS_DEBUG_CODE 5 /* extra messages to help find/debug errors */
void reiserfs_warning(struct super_block *s, const char *fmt, ...); void __reiserfs_warning(struct super_block *s, const char *id,
const char *func, const char *fmt, ...);
#define reiserfs_warning(s, id, fmt, args...) \
__reiserfs_warning(s, id, __func__, fmt, ##args)
/* assertions handling */ /* assertions handling */
/** always check a condition and panic if it's false. */ /** always check a condition and panic if it's false. */
...@@ -558,7 +561,7 @@ static inline int uniqueness2type(__u32 uniqueness) ...@@ -558,7 +561,7 @@ static inline int uniqueness2type(__u32 uniqueness)
case V1_DIRENTRY_UNIQUENESS: case V1_DIRENTRY_UNIQUENESS:
return TYPE_DIRENTRY; return TYPE_DIRENTRY;
default: default:
reiserfs_warning(NULL, "vs-500: unknown uniqueness %d", reiserfs_warning(NULL, "vs-500", "unknown uniqueness %d",
uniqueness); uniqueness);
case V1_ANY_UNIQUENESS: case V1_ANY_UNIQUENESS:
return TYPE_ANY; return TYPE_ANY;
...@@ -578,7 +581,7 @@ static inline __u32 type2uniqueness(int type) ...@@ -578,7 +581,7 @@ static inline __u32 type2uniqueness(int type)
case TYPE_DIRENTRY: case TYPE_DIRENTRY:
return V1_DIRENTRY_UNIQUENESS; return V1_DIRENTRY_UNIQUENESS;
default: default:
reiserfs_warning(NULL, "vs-501: unknown type %d", type); reiserfs_warning(NULL, "vs-501", "unknown type %d", type);
case TYPE_ANY: case TYPE_ANY:
return V1_ANY_UNIQUENESS; return V1_ANY_UNIQUENESS;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册