diff options
author | Jeff Mahoney <jeffm@suse.com> | 2009-03-30 14:02:25 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-03-30 15:16:36 -0400 |
commit | c3a9c2109f84882b9b3178f6b1838d550d3df0ec (patch) | |
tree | 08a502b8013eabb562f03be45622b0f63b1a34b9 /fs/reiserfs/stree.c | |
parent | 78b6513d2881f1a759fb9825a036d926392de084 (diff) |
reiserfs: rework reiserfs_panic
ReiserFS panics 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/stree.c')
-rw-r--r-- | fs/reiserfs/stree.c | 49 |
1 files changed, 23 insertions, 26 deletions
diff --git a/fs/reiserfs/stree.c b/fs/reiserfs/stree.c index f328d27a19d5..2de1e309124b 100644 --- a/fs/reiserfs/stree.c +++ b/fs/reiserfs/stree.c | |||
@@ -366,9 +366,8 @@ inline void decrement_bcount(struct buffer_head *p_s_bh) | |||
366 | put_bh(p_s_bh); | 366 | put_bh(p_s_bh); |
367 | return; | 367 | return; |
368 | } | 368 | } |
369 | reiserfs_panic(NULL, | 369 | reiserfs_panic(NULL, "PAP-5070", |
370 | "PAP-5070: decrement_bcount: trying to free free buffer %b", | 370 | "trying to free free buffer %b", p_s_bh); |
371 | p_s_bh); | ||
372 | } | 371 | } |
373 | } | 372 | } |
374 | 373 | ||
@@ -713,8 +712,8 @@ int search_by_key(struct super_block *p_s_sb, const struct cpu_key *p_s_key, /* | |||
713 | #ifdef CONFIG_REISERFS_CHECK | 712 | #ifdef CONFIG_REISERFS_CHECK |
714 | if (cur_tb) { | 713 | if (cur_tb) { |
715 | print_cur_tb("5140"); | 714 | print_cur_tb("5140"); |
716 | reiserfs_panic(p_s_sb, | 715 | reiserfs_panic(p_s_sb, "PAP-5140", |
717 | "PAP-5140: search_by_key: schedule occurred in do_balance!"); | 716 | "schedule occurred in do_balance!"); |
718 | } | 717 | } |
719 | #endif | 718 | #endif |
720 | 719 | ||
@@ -1511,8 +1510,8 @@ static void indirect_to_direct_roll_back(struct reiserfs_transaction_handle *th, | |||
1511 | /* look for the last byte of the tail */ | 1510 | /* look for the last byte of the tail */ |
1512 | if (search_for_position_by_key(inode->i_sb, &tail_key, path) == | 1511 | if (search_for_position_by_key(inode->i_sb, &tail_key, path) == |
1513 | POSITION_NOT_FOUND) | 1512 | POSITION_NOT_FOUND) |
1514 | reiserfs_panic(inode->i_sb, | 1513 | reiserfs_panic(inode->i_sb, "vs-5615", |
1515 | "vs-5615: indirect_to_direct_roll_back: found invalid item"); | 1514 | "found invalid item"); |
1516 | RFALSE(path->pos_in_item != | 1515 | RFALSE(path->pos_in_item != |
1517 | ih_item_len(PATH_PITEM_HEAD(path)) - 1, | 1516 | ih_item_len(PATH_PITEM_HEAD(path)) - 1, |
1518 | "vs-5616: appended bytes found"); | 1517 | "vs-5616: appended bytes found"); |
@@ -1612,8 +1611,8 @@ int reiserfs_cut_from_item(struct reiserfs_transaction_handle *th, | |||
1612 | print_block(PATH_PLAST_BUFFER(p_s_path), 3, | 1611 | print_block(PATH_PLAST_BUFFER(p_s_path), 3, |
1613 | PATH_LAST_POSITION(p_s_path) - 1, | 1612 | PATH_LAST_POSITION(p_s_path) - 1, |
1614 | PATH_LAST_POSITION(p_s_path) + 1); | 1613 | PATH_LAST_POSITION(p_s_path) + 1); |
1615 | reiserfs_panic(p_s_sb, | 1614 | reiserfs_panic(p_s_sb, "PAP-5580", "item to " |
1616 | "PAP-5580: reiserfs_cut_from_item: item to convert does not exist (%K)", | 1615 | "convert does not exist (%K)", |
1617 | p_s_item_key); | 1616 | p_s_item_key); |
1618 | } | 1617 | } |
1619 | continue; | 1618 | continue; |
@@ -1693,22 +1692,20 @@ int reiserfs_cut_from_item(struct reiserfs_transaction_handle *th, | |||
1693 | sure, that we exactly remove last unformatted node pointer | 1692 | sure, that we exactly remove last unformatted node pointer |
1694 | of the item */ | 1693 | of the item */ |
1695 | if (!is_indirect_le_ih(le_ih)) | 1694 | if (!is_indirect_le_ih(le_ih)) |
1696 | reiserfs_panic(p_s_sb, | 1695 | reiserfs_panic(p_s_sb, "vs-5652", |
1697 | "vs-5652: reiserfs_cut_from_item: " | ||
1698 | "item must be indirect %h", le_ih); | 1696 | "item must be indirect %h", le_ih); |
1699 | 1697 | ||
1700 | if (c_mode == M_DELETE && ih_item_len(le_ih) != UNFM_P_SIZE) | 1698 | if (c_mode == M_DELETE && ih_item_len(le_ih) != UNFM_P_SIZE) |
1701 | reiserfs_panic(p_s_sb, | 1699 | reiserfs_panic(p_s_sb, "vs-5653", "completing " |
1702 | "vs-5653: reiserfs_cut_from_item: " | 1700 | "indirect2direct conversion indirect " |
1703 | "completing indirect2direct conversion indirect item %h " | 1701 | "item %h being deleted must be of " |
1704 | "being deleted must be of 4 byte long", | 1702 | "4 byte long", le_ih); |
1705 | le_ih); | ||
1706 | 1703 | ||
1707 | if (c_mode == M_CUT | 1704 | if (c_mode == M_CUT |
1708 | && s_cut_balance.insert_size[0] != -UNFM_P_SIZE) { | 1705 | && s_cut_balance.insert_size[0] != -UNFM_P_SIZE) { |
1709 | reiserfs_panic(p_s_sb, | 1706 | reiserfs_panic(p_s_sb, "vs-5654", "can not complete " |
1710 | "vs-5654: reiserfs_cut_from_item: " | 1707 | "indirect2direct conversion of %h " |
1711 | "can not complete indirect2direct conversion of %h (CUT, insert_size==%d)", | 1708 | "(CUT, insert_size==%d)", |
1712 | le_ih, s_cut_balance.insert_size[0]); | 1709 | le_ih, s_cut_balance.insert_size[0]); |
1713 | } | 1710 | } |
1714 | /* it would be useful to make sure, that right neighboring | 1711 | /* it would be useful to make sure, that right neighboring |
@@ -1923,10 +1920,10 @@ static void check_research_for_paste(struct treepath *path, | |||
1923 | || op_bytes_number(found_ih, | 1920 | || op_bytes_number(found_ih, |
1924 | get_last_bh(path)->b_size) != | 1921 | get_last_bh(path)->b_size) != |
1925 | pos_in_item(path)) | 1922 | pos_in_item(path)) |
1926 | reiserfs_panic(NULL, | 1923 | reiserfs_panic(NULL, "PAP-5720", "found direct item " |
1927 | "PAP-5720: check_research_for_paste: " | 1924 | "%h or position (%d) does not match " |
1928 | "found direct item %h or position (%d) does not match to key %K", | 1925 | "to key %K", found_ih, |
1929 | found_ih, pos_in_item(path), p_s_key); | 1926 | pos_in_item(path), p_s_key); |
1930 | } | 1927 | } |
1931 | if (is_indirect_le_ih(found_ih)) { | 1928 | if (is_indirect_le_ih(found_ih)) { |
1932 | if (le_ih_k_offset(found_ih) + | 1929 | if (le_ih_k_offset(found_ih) + |
@@ -1935,9 +1932,9 @@ static void check_research_for_paste(struct treepath *path, | |||
1935 | cpu_key_k_offset(p_s_key) | 1932 | cpu_key_k_offset(p_s_key) |
1936 | || I_UNFM_NUM(found_ih) != pos_in_item(path) | 1933 | || I_UNFM_NUM(found_ih) != pos_in_item(path) |
1937 | || get_ih_free_space(found_ih) != 0) | 1934 | || get_ih_free_space(found_ih) != 0) |
1938 | reiserfs_panic(NULL, | 1935 | reiserfs_panic(NULL, "PAP-5730", "found indirect " |
1939 | "PAP-5730: check_research_for_paste: " | 1936 | "item (%h) or position (%d) does not " |
1940 | "found indirect item (%h) or position (%d) does not match to key (%K)", | 1937 | "match to key (%K)", |
1941 | found_ih, pos_in_item(path), p_s_key); | 1938 | found_ih, pos_in_item(path), p_s_key); |
1942 | } | 1939 | } |
1943 | } | 1940 | } |