diff options
author | Jeff Mahoney <jeffm@suse.com> | 2009-03-30 14:02:21 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-03-30 15:16:36 -0400 |
commit | 45b03d5e8e674eb6555b767e1c8eb40b671ff892 (patch) | |
tree | d74acd1be7f5102143df960e8cd692aadcc437df /fs/reiserfs/inode.c | |
parent | 1d889d9958490888b3fad1d486145d9a03559cbc (diff) |
reiserfs: rework reiserfs_warning
ReiserFS warnings can be somewhat inconsistent.
In some cases:
* a unique identifier may be associated with it
* the function name may be included
* the device may be printed separately
This patch aims to make warnings more consistent. reiserfs_warning() prints
the device name, so printing it a second time is not required. The function
name for a warning is always helpful in debugging, so it is now automatically
inserted into the output. Hans has stated that every warning should have
a unique identifier. Some cases lack them, others really shouldn't have them.
reiserfs_warning() now expects an id associated with each message. In the
rare case where one isn't needed, "" will suffice.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/reiserfs/inode.c')
-rw-r--r-- | fs/reiserfs/inode.c | 60 |
1 files changed, 29 insertions, 31 deletions
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 | } |