aboutsummaryrefslogtreecommitdiffstats
path: root/fs/reiserfs/journal.c
diff options
context:
space:
mode:
authorJeff Mahoney <jeffm@suse.com>2009-03-30 14:02:25 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-03-30 15:16:36 -0400
commitc3a9c2109f84882b9b3178f6b1838d550d3df0ec (patch)
tree08a502b8013eabb562f03be45622b0f63b1a34b9 /fs/reiserfs/journal.c
parent78b6513d2881f1a759fb9825a036d926392de084 (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/journal.c')
-rw-r--r--fs/reiserfs/journal.c57
1 files changed, 29 insertions, 28 deletions
diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c
index 88a031fafd07..774f3ba37409 100644
--- a/fs/reiserfs/journal.c
+++ b/fs/reiserfs/journal.c
@@ -436,8 +436,8 @@ void reiserfs_check_lock_depth(struct super_block *sb, char *caller)
436{ 436{
437#ifdef CONFIG_SMP 437#ifdef CONFIG_SMP
438 if (current->lock_depth < 0) { 438 if (current->lock_depth < 0) {
439 reiserfs_panic(sb, "%s called without kernel lock held", 439 reiserfs_panic(sb, "journal-1", "%s called without kernel "
440 caller); 440 "lock held", caller);
441 } 441 }
442#else 442#else
443 ; 443 ;
@@ -574,7 +574,7 @@ static inline void put_journal_list(struct super_block *s,
574 struct reiserfs_journal_list *jl) 574 struct reiserfs_journal_list *jl)
575{ 575{
576 if (jl->j_refcount < 1) { 576 if (jl->j_refcount < 1) {
577 reiserfs_panic(s, "trans id %u, refcount at %d", 577 reiserfs_panic(s, "journal-2", "trans id %u, refcount at %d",
578 jl->j_trans_id, jl->j_refcount); 578 jl->j_trans_id, jl->j_refcount);
579 } 579 }
580 if (--jl->j_refcount == 0) 580 if (--jl->j_refcount == 0)
@@ -1416,8 +1416,7 @@ static int flush_journal_list(struct super_block *s,
1416 1416
1417 count = 0; 1417 count = 0;
1418 if (j_len_saved > journal->j_trans_max) { 1418 if (j_len_saved > journal->j_trans_max) {
1419 reiserfs_panic(s, 1419 reiserfs_panic(s, "journal-715", "length is %lu, trans id %lu",
1420 "journal-715: flush_journal_list, length is %lu, trans id %lu\n",
1421 j_len_saved, jl->j_trans_id); 1420 j_len_saved, jl->j_trans_id);
1422 return 0; 1421 return 0;
1423 } 1422 }
@@ -1449,8 +1448,8 @@ static int flush_journal_list(struct super_block *s,
1449 ** or wait on a more recent transaction, or just ignore it 1448 ** or wait on a more recent transaction, or just ignore it
1450 */ 1449 */
1451 if (atomic_read(&(journal->j_wcount)) != 0) { 1450 if (atomic_read(&(journal->j_wcount)) != 0) {
1452 reiserfs_panic(s, 1451 reiserfs_panic(s, "journal-844", "journal list is flushing, "
1453 "journal-844: panic journal list is flushing, wcount is not 0\n"); 1452 "wcount is not 0");
1454 } 1453 }
1455 cn = jl->j_realblock; 1454 cn = jl->j_realblock;
1456 while (cn) { 1455 while (cn) {
@@ -1551,13 +1550,13 @@ static int flush_journal_list(struct super_block *s,
1551 while (cn) { 1550 while (cn) {
1552 if (test_bit(BLOCK_NEEDS_FLUSH, &cn->state)) { 1551 if (test_bit(BLOCK_NEEDS_FLUSH, &cn->state)) {
1553 if (!cn->bh) { 1552 if (!cn->bh) {
1554 reiserfs_panic(s, 1553 reiserfs_panic(s, "journal-1011",
1555 "journal-1011: cn->bh is NULL\n"); 1554 "cn->bh is NULL");
1556 } 1555 }
1557 wait_on_buffer(cn->bh); 1556 wait_on_buffer(cn->bh);
1558 if (!cn->bh) { 1557 if (!cn->bh) {
1559 reiserfs_panic(s, 1558 reiserfs_panic(s, "journal-1012",
1560 "journal-1012: cn->bh is NULL\n"); 1559 "cn->bh is NULL");
1561 } 1560 }
1562 if (unlikely(!buffer_uptodate(cn->bh))) { 1561 if (unlikely(!buffer_uptodate(cn->bh))) {
1563#ifdef CONFIG_REISERFS_CHECK 1562#ifdef CONFIG_REISERFS_CHECK
@@ -3255,8 +3254,8 @@ int journal_mark_dirty(struct reiserfs_transaction_handle *th,
3255 3254
3256 PROC_INFO_INC(p_s_sb, journal.mark_dirty); 3255 PROC_INFO_INC(p_s_sb, journal.mark_dirty);
3257 if (th->t_trans_id != journal->j_trans_id) { 3256 if (th->t_trans_id != journal->j_trans_id) {
3258 reiserfs_panic(th->t_super, 3257 reiserfs_panic(th->t_super, "journal-1577",
3259 "journal-1577: handle trans id %ld != current trans id %ld\n", 3258 "handle trans id %ld != current trans id %ld",
3260 th->t_trans_id, journal->j_trans_id); 3259 th->t_trans_id, journal->j_trans_id);
3261 } 3260 }
3262 3261
@@ -3295,8 +3294,8 @@ int journal_mark_dirty(struct reiserfs_transaction_handle *th,
3295 ** Nothing can be done here, except make the FS readonly or panic. 3294 ** Nothing can be done here, except make the FS readonly or panic.
3296 */ 3295 */
3297 if (journal->j_len >= journal->j_trans_max) { 3296 if (journal->j_len >= journal->j_trans_max) {
3298 reiserfs_panic(th->t_super, 3297 reiserfs_panic(th->t_super, "journal-1413",
3299 "journal-1413: journal_mark_dirty: j_len (%lu) is too big\n", 3298 "j_len (%lu) is too big",
3300 journal->j_len); 3299 journal->j_len);
3301 } 3300 }
3302 3301
@@ -3316,7 +3315,8 @@ int journal_mark_dirty(struct reiserfs_transaction_handle *th,
3316 if (!cn) { 3315 if (!cn) {
3317 cn = get_cnode(p_s_sb); 3316 cn = get_cnode(p_s_sb);
3318 if (!cn) { 3317 if (!cn) {
3319 reiserfs_panic(p_s_sb, "get_cnode failed!\n"); 3318 reiserfs_panic(p_s_sb, "journal-4",
3319 "get_cnode failed!");
3320 } 3320 }
3321 3321
3322 if (th->t_blocks_logged == th->t_blocks_allocated) { 3322 if (th->t_blocks_logged == th->t_blocks_allocated) {
@@ -3584,8 +3584,8 @@ static int check_journal_end(struct reiserfs_transaction_handle *th,
3584 BUG_ON(!th->t_trans_id); 3584 BUG_ON(!th->t_trans_id);
3585 3585
3586 if (th->t_trans_id != journal->j_trans_id) { 3586 if (th->t_trans_id != journal->j_trans_id) {
3587 reiserfs_panic(th->t_super, 3587 reiserfs_panic(th->t_super, "journal-1577",
3588 "journal-1577: handle trans id %ld != current trans id %ld\n", 3588 "handle trans id %ld != current trans id %ld",
3589 th->t_trans_id, journal->j_trans_id); 3589 th->t_trans_id, journal->j_trans_id);
3590 } 3590 }
3591 3591
@@ -3664,8 +3664,8 @@ static int check_journal_end(struct reiserfs_transaction_handle *th,
3664 } 3664 }
3665 3665
3666 if (journal->j_start > SB_ONDISK_JOURNAL_SIZE(p_s_sb)) { 3666 if (journal->j_start > SB_ONDISK_JOURNAL_SIZE(p_s_sb)) {
3667 reiserfs_panic(p_s_sb, 3667 reiserfs_panic(p_s_sb, "journal-003",
3668 "journal-003: journal_end: j_start (%ld) is too high\n", 3668 "j_start (%ld) is too high",
3669 journal->j_start); 3669 journal->j_start);
3670 } 3670 }
3671 return 1; 3671 return 1;
@@ -3710,8 +3710,8 @@ int journal_mark_freed(struct reiserfs_transaction_handle *th,
3710 /* set the bit for this block in the journal bitmap for this transaction */ 3710 /* set the bit for this block in the journal bitmap for this transaction */
3711 jb = journal->j_current_jl->j_list_bitmap; 3711 jb = journal->j_current_jl->j_list_bitmap;
3712 if (!jb) { 3712 if (!jb) {
3713 reiserfs_panic(p_s_sb, 3713 reiserfs_panic(p_s_sb, "journal-1702",
3714 "journal-1702: journal_mark_freed, journal_list_bitmap is NULL\n"); 3714 "journal_list_bitmap is NULL");
3715 } 3715 }
3716 set_bit_in_list_bitmap(p_s_sb, blocknr, jb); 3716 set_bit_in_list_bitmap(p_s_sb, blocknr, jb);
3717 3717
@@ -4066,8 +4066,8 @@ static int do_journal_end(struct reiserfs_transaction_handle *th,
4066 if (buffer_journaled(cn->bh)) { 4066 if (buffer_journaled(cn->bh)) {
4067 jl_cn = get_cnode(p_s_sb); 4067 jl_cn = get_cnode(p_s_sb);
4068 if (!jl_cn) { 4068 if (!jl_cn) {
4069 reiserfs_panic(p_s_sb, 4069 reiserfs_panic(p_s_sb, "journal-1676",
4070 "journal-1676, get_cnode returned NULL\n"); 4070 "get_cnode returned NULL");
4071 } 4071 }
4072 if (i == 0) { 4072 if (i == 0) {
4073 jl->j_realblock = jl_cn; 4073 jl->j_realblock = jl_cn;
@@ -4083,8 +4083,9 @@ static int do_journal_end(struct reiserfs_transaction_handle *th,
4083 4083
4084 if (is_block_in_log_or_reserved_area 4084 if (is_block_in_log_or_reserved_area
4085 (p_s_sb, cn->bh->b_blocknr)) { 4085 (p_s_sb, cn->bh->b_blocknr)) {
4086 reiserfs_panic(p_s_sb, 4086 reiserfs_panic(p_s_sb, "journal-2332",
4087 "journal-2332: Trying to log block %lu, which is a log block\n", 4087 "Trying to log block %lu, "
4088 "which is a log block",
4088 cn->bh->b_blocknr); 4089 cn->bh->b_blocknr);
4089 } 4090 }
4090 jl_cn->blocknr = cn->bh->b_blocknr; 4091 jl_cn->blocknr = cn->bh->b_blocknr;
@@ -4268,8 +4269,8 @@ static int do_journal_end(struct reiserfs_transaction_handle *th,
4268 get_list_bitmap(p_s_sb, journal->j_current_jl); 4269 get_list_bitmap(p_s_sb, journal->j_current_jl);
4269 4270
4270 if (!(journal->j_current_jl->j_list_bitmap)) { 4271 if (!(journal->j_current_jl->j_list_bitmap)) {
4271 reiserfs_panic(p_s_sb, 4272 reiserfs_panic(p_s_sb, "journal-1996",
4272 "journal-1996: do_journal_end, could not get a list bitmap\n"); 4273 "could not get a list bitmap");
4273 } 4274 }
4274 4275
4275 atomic_set(&(journal->j_jlock), 0); 4276 atomic_set(&(journal->j_jlock), 0);