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/lbalance.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/lbalance.c')
-rw-r--r-- | fs/reiserfs/lbalance.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/fs/reiserfs/lbalance.c b/fs/reiserfs/lbalance.c index 381339b432e7..67f1d1de213d 100644 --- a/fs/reiserfs/lbalance.c +++ b/fs/reiserfs/lbalance.c | |||
@@ -168,10 +168,11 @@ static int leaf_copy_boundary_item(struct buffer_info *dest_bi, | |||
168 | if (bytes_or_entries == ih_item_len(ih) | 168 | if (bytes_or_entries == ih_item_len(ih) |
169 | && is_indirect_le_ih(ih)) | 169 | && is_indirect_le_ih(ih)) |
170 | if (get_ih_free_space(ih)) | 170 | if (get_ih_free_space(ih)) |
171 | reiserfs_panic(NULL, | 171 | reiserfs_panic(sb_from_bi(dest_bi), |
172 | "vs-10020: leaf_copy_boundary_item: " | 172 | "vs-10020", |
173 | "last unformatted node must be filled entirely (%h)", | 173 | "last unformatted node " |
174 | ih); | 174 | "must be filled " |
175 | "entirely (%h)", ih); | ||
175 | } | 176 | } |
176 | #endif | 177 | #endif |
177 | 178 | ||
@@ -622,9 +623,8 @@ static void leaf_define_dest_src_infos(int shift_mode, struct tree_balance *tb, | |||
622 | break; | 623 | break; |
623 | 624 | ||
624 | default: | 625 | default: |
625 | reiserfs_panic(NULL, | 626 | reiserfs_panic(sb_from_bi(src_bi), "vs-10250", |
626 | "vs-10250: leaf_define_dest_src_infos: shift type is unknown (%d)", | 627 | "shift type is unknown (%d)", shift_mode); |
627 | shift_mode); | ||
628 | } | 628 | } |
629 | RFALSE(!src_bi->bi_bh || !dest_bi->bi_bh, | 629 | RFALSE(!src_bi->bi_bh || !dest_bi->bi_bh, |
630 | "vs-10260: mode==%d, source (%p) or dest (%p) buffer is initialized incorrectly", | 630 | "vs-10260: mode==%d, source (%p) or dest (%p) buffer is initialized incorrectly", |
@@ -674,9 +674,9 @@ int leaf_shift_left(struct tree_balance *tb, int shift_num, int shift_bytes) | |||
674 | #ifdef CONFIG_REISERFS_CHECK | 674 | #ifdef CONFIG_REISERFS_CHECK |
675 | if (tb->tb_mode == M_PASTE || tb->tb_mode == M_INSERT) { | 675 | if (tb->tb_mode == M_PASTE || tb->tb_mode == M_INSERT) { |
676 | print_cur_tb("vs-10275"); | 676 | print_cur_tb("vs-10275"); |
677 | reiserfs_panic(tb->tb_sb, | 677 | reiserfs_panic(tb->tb_sb, "vs-10275", |
678 | "vs-10275: leaf_shift_left: balance condition corrupted (%c)", | 678 | "balance condition corrupted " |
679 | tb->tb_mode); | 679 | "(%c)", tb->tb_mode); |
680 | } | 680 | } |
681 | #endif | 681 | #endif |
682 | 682 | ||
@@ -889,9 +889,12 @@ void leaf_paste_in_buffer(struct buffer_info *bi, int affected_item_num, | |||
889 | 889 | ||
890 | #ifdef CONFIG_REISERFS_CHECK | 890 | #ifdef CONFIG_REISERFS_CHECK |
891 | if (zeros_number > paste_size) { | 891 | if (zeros_number > paste_size) { |
892 | struct super_block *sb = NULL; | ||
893 | if (bi && bi->tb) | ||
894 | sb = bi->tb->tb_sb; | ||
892 | print_cur_tb("10177"); | 895 | print_cur_tb("10177"); |
893 | reiserfs_panic(NULL, | 896 | reiserfs_panic(sb, "vs-10177", |
894 | "vs-10177: leaf_paste_in_buffer: ero number == %d, paste_size == %d", | 897 | "zeros_number == %d, paste_size == %d", |
895 | zeros_number, paste_size); | 898 | zeros_number, paste_size); |
896 | } | 899 | } |
897 | #endif /* CONFIG_REISERFS_CHECK */ | 900 | #endif /* CONFIG_REISERFS_CHECK */ |