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/journal.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/journal.c')
-rw-r--r-- | fs/reiserfs/journal.c | 174 |
1 files changed, 93 insertions, 81 deletions
diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c index 677bb926e7d6..88a031fafd07 100644 --- a/fs/reiserfs/journal.c +++ b/fs/reiserfs/journal.c | |||
@@ -300,8 +300,8 @@ int reiserfs_allocate_list_bitmaps(struct super_block *p_s_sb, | |||
300 | jb->journal_list = NULL; | 300 | jb->journal_list = NULL; |
301 | jb->bitmaps = vmalloc(mem); | 301 | jb->bitmaps = vmalloc(mem); |
302 | if (!jb->bitmaps) { | 302 | if (!jb->bitmaps) { |
303 | reiserfs_warning(p_s_sb, | 303 | reiserfs_warning(p_s_sb, "clm-2000", "unable to " |
304 | "clm-2000, unable to allocate bitmaps for journal lists"); | 304 | "allocate bitmaps for journal lists"); |
305 | failed = 1; | 305 | failed = 1; |
306 | break; | 306 | break; |
307 | } | 307 | } |
@@ -644,8 +644,8 @@ static void reiserfs_end_buffer_io_sync(struct buffer_head *bh, int uptodate) | |||
644 | char b[BDEVNAME_SIZE]; | 644 | char b[BDEVNAME_SIZE]; |
645 | 645 | ||
646 | if (buffer_journaled(bh)) { | 646 | if (buffer_journaled(bh)) { |
647 | reiserfs_warning(NULL, | 647 | reiserfs_warning(NULL, "clm-2084", |
648 | "clm-2084: pinned buffer %lu:%s sent to disk", | 648 | "pinned buffer %lu:%s sent to disk", |
649 | bh->b_blocknr, bdevname(bh->b_bdev, b)); | 649 | bh->b_blocknr, bdevname(bh->b_bdev, b)); |
650 | } | 650 | } |
651 | if (uptodate) | 651 | if (uptodate) |
@@ -1122,7 +1122,8 @@ static int flush_commit_list(struct super_block *s, | |||
1122 | sync_dirty_buffer(tbh); | 1122 | sync_dirty_buffer(tbh); |
1123 | if (unlikely(!buffer_uptodate(tbh))) { | 1123 | if (unlikely(!buffer_uptodate(tbh))) { |
1124 | #ifdef CONFIG_REISERFS_CHECK | 1124 | #ifdef CONFIG_REISERFS_CHECK |
1125 | reiserfs_warning(s, "journal-601, buffer write failed"); | 1125 | reiserfs_warning(s, "journal-601", |
1126 | "buffer write failed"); | ||
1126 | #endif | 1127 | #endif |
1127 | retval = -EIO; | 1128 | retval = -EIO; |
1128 | } | 1129 | } |
@@ -1154,14 +1155,14 @@ static int flush_commit_list(struct super_block *s, | |||
1154 | * up propagating the write error out to the filesystem. */ | 1155 | * up propagating the write error out to the filesystem. */ |
1155 | if (unlikely(!buffer_uptodate(jl->j_commit_bh))) { | 1156 | if (unlikely(!buffer_uptodate(jl->j_commit_bh))) { |
1156 | #ifdef CONFIG_REISERFS_CHECK | 1157 | #ifdef CONFIG_REISERFS_CHECK |
1157 | reiserfs_warning(s, "journal-615: buffer write failed"); | 1158 | reiserfs_warning(s, "journal-615", "buffer write failed"); |
1158 | #endif | 1159 | #endif |
1159 | retval = -EIO; | 1160 | retval = -EIO; |
1160 | } | 1161 | } |
1161 | bforget(jl->j_commit_bh); | 1162 | bforget(jl->j_commit_bh); |
1162 | if (journal->j_last_commit_id != 0 && | 1163 | if (journal->j_last_commit_id != 0 && |
1163 | (jl->j_trans_id - journal->j_last_commit_id) != 1) { | 1164 | (jl->j_trans_id - journal->j_last_commit_id) != 1) { |
1164 | reiserfs_warning(s, "clm-2200: last commit %lu, current %lu", | 1165 | reiserfs_warning(s, "clm-2200", "last commit %lu, current %lu", |
1165 | journal->j_last_commit_id, jl->j_trans_id); | 1166 | journal->j_last_commit_id, jl->j_trans_id); |
1166 | } | 1167 | } |
1167 | journal->j_last_commit_id = jl->j_trans_id; | 1168 | 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 | while (cn) { | 1251 | while (cn) { |
1251 | if (cn->blocknr != 0) { | 1252 | if (cn->blocknr != 0) { |
1252 | if (debug) { | 1253 | if (debug) { |
1253 | reiserfs_warning(p_s_sb, | 1254 | reiserfs_warning(p_s_sb, "reiserfs-2201", |
1254 | "block %u, bh is %d, state %ld", | 1255 | "block %u, bh is %d, state %ld", |
1255 | cn->blocknr, cn->bh ? 1 : 0, | 1256 | cn->blocknr, cn->bh ? 1 : 0, |
1256 | cn->state); | 1257 | cn->state); |
@@ -1288,8 +1289,8 @@ static int _update_journal_header_block(struct super_block *p_s_sb, | |||
1288 | wait_on_buffer((journal->j_header_bh)); | 1289 | wait_on_buffer((journal->j_header_bh)); |
1289 | if (unlikely(!buffer_uptodate(journal->j_header_bh))) { | 1290 | if (unlikely(!buffer_uptodate(journal->j_header_bh))) { |
1290 | #ifdef CONFIG_REISERFS_CHECK | 1291 | #ifdef CONFIG_REISERFS_CHECK |
1291 | reiserfs_warning(p_s_sb, | 1292 | reiserfs_warning(p_s_sb, "journal-699", |
1292 | "journal-699: buffer write failed"); | 1293 | "buffer write failed"); |
1293 | #endif | 1294 | #endif |
1294 | return -EIO; | 1295 | return -EIO; |
1295 | } | 1296 | } |
@@ -1319,8 +1320,8 @@ static int _update_journal_header_block(struct super_block *p_s_sb, | |||
1319 | sync_dirty_buffer(journal->j_header_bh); | 1320 | sync_dirty_buffer(journal->j_header_bh); |
1320 | } | 1321 | } |
1321 | if (!buffer_uptodate(journal->j_header_bh)) { | 1322 | if (!buffer_uptodate(journal->j_header_bh)) { |
1322 | reiserfs_warning(p_s_sb, | 1323 | reiserfs_warning(p_s_sb, "journal-837", |
1323 | "journal-837: IO error during journal replay"); | 1324 | "IO error during journal replay"); |
1324 | return -EIO; | 1325 | return -EIO; |
1325 | } | 1326 | } |
1326 | } | 1327 | } |
@@ -1401,8 +1402,7 @@ static int flush_journal_list(struct super_block *s, | |||
1401 | BUG_ON(j_len_saved <= 0); | 1402 | BUG_ON(j_len_saved <= 0); |
1402 | 1403 | ||
1403 | if (atomic_read(&journal->j_wcount) != 0) { | 1404 | if (atomic_read(&journal->j_wcount) != 0) { |
1404 | reiserfs_warning(s, | 1405 | reiserfs_warning(s, "clm-2048", "called with wcount %d", |
1405 | "clm-2048: flush_journal_list called with wcount %d", | ||
1406 | atomic_read(&journal->j_wcount)); | 1406 | atomic_read(&journal->j_wcount)); |
1407 | } | 1407 | } |
1408 | BUG_ON(jl->j_trans_id == 0); | 1408 | BUG_ON(jl->j_trans_id == 0); |
@@ -1510,8 +1510,8 @@ static int flush_journal_list(struct super_block *s, | |||
1510 | ** is not marked JDirty_wait | 1510 | ** is not marked JDirty_wait |
1511 | */ | 1511 | */ |
1512 | if ((!was_jwait) && !buffer_locked(saved_bh)) { | 1512 | if ((!was_jwait) && !buffer_locked(saved_bh)) { |
1513 | reiserfs_warning(s, | 1513 | reiserfs_warning(s, "journal-813", |
1514 | "journal-813: BAD! buffer %llu %cdirty %cjwait, " | 1514 | "BAD! buffer %llu %cdirty %cjwait, " |
1515 | "not in a newer tranasction", | 1515 | "not in a newer tranasction", |
1516 | (unsigned long long)saved_bh-> | 1516 | (unsigned long long)saved_bh-> |
1517 | b_blocknr, was_dirty ? ' ' : '!', | 1517 | b_blocknr, was_dirty ? ' ' : '!', |
@@ -1529,8 +1529,8 @@ static int flush_journal_list(struct super_block *s, | |||
1529 | unlock_buffer(saved_bh); | 1529 | unlock_buffer(saved_bh); |
1530 | count++; | 1530 | count++; |
1531 | } else { | 1531 | } else { |
1532 | reiserfs_warning(s, | 1532 | reiserfs_warning(s, "clm-2082", |
1533 | "clm-2082: Unable to flush buffer %llu in %s", | 1533 | "Unable to flush buffer %llu in %s", |
1534 | (unsigned long long)saved_bh-> | 1534 | (unsigned long long)saved_bh-> |
1535 | b_blocknr, __func__); | 1535 | b_blocknr, __func__); |
1536 | } | 1536 | } |
@@ -1541,8 +1541,8 @@ static int flush_journal_list(struct super_block *s, | |||
1541 | /* we incremented this to keep others from taking the buffer head away */ | 1541 | /* we incremented this to keep others from taking the buffer head away */ |
1542 | put_bh(saved_bh); | 1542 | put_bh(saved_bh); |
1543 | if (atomic_read(&(saved_bh->b_count)) < 0) { | 1543 | if (atomic_read(&(saved_bh->b_count)) < 0) { |
1544 | reiserfs_warning(s, | 1544 | reiserfs_warning(s, "journal-945", |
1545 | "journal-945: saved_bh->b_count < 0"); | 1545 | "saved_bh->b_count < 0"); |
1546 | } | 1546 | } |
1547 | } | 1547 | } |
1548 | } | 1548 | } |
@@ -1561,8 +1561,8 @@ static int flush_journal_list(struct super_block *s, | |||
1561 | } | 1561 | } |
1562 | if (unlikely(!buffer_uptodate(cn->bh))) { | 1562 | if (unlikely(!buffer_uptodate(cn->bh))) { |
1563 | #ifdef CONFIG_REISERFS_CHECK | 1563 | #ifdef CONFIG_REISERFS_CHECK |
1564 | reiserfs_warning(s, | 1564 | reiserfs_warning(s, "journal-949", |
1565 | "journal-949: buffer write failed\n"); | 1565 | "buffer write failed"); |
1566 | #endif | 1566 | #endif |
1567 | err = -EIO; | 1567 | err = -EIO; |
1568 | } | 1568 | } |
@@ -1623,7 +1623,7 @@ static int flush_journal_list(struct super_block *s, | |||
1623 | 1623 | ||
1624 | if (journal->j_last_flush_id != 0 && | 1624 | if (journal->j_last_flush_id != 0 && |
1625 | (jl->j_trans_id - journal->j_last_flush_id) != 1) { | 1625 | (jl->j_trans_id - journal->j_last_flush_id) != 1) { |
1626 | reiserfs_warning(s, "clm-2201: last flush %lu, current %lu", | 1626 | reiserfs_warning(s, "clm-2201", "last flush %lu, current %lu", |
1627 | journal->j_last_flush_id, jl->j_trans_id); | 1627 | journal->j_last_flush_id, jl->j_trans_id); |
1628 | } | 1628 | } |
1629 | journal->j_last_flush_id = jl->j_trans_id; | 1629 | 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 | return -1; | 2058 | return -1; |
2059 | } | 2059 | } |
2060 | if (get_desc_trans_len(desc) > SB_JOURNAL(p_s_sb)->j_trans_max) { | 2060 | if (get_desc_trans_len(desc) > SB_JOURNAL(p_s_sb)->j_trans_max) { |
2061 | reiserfs_warning(p_s_sb, | 2061 | reiserfs_warning(p_s_sb, "journal-2018", |
2062 | "journal-2018: Bad transaction length %d encountered, ignoring transaction", | 2062 | "Bad transaction length %d " |
2063 | "encountered, ignoring transaction", | ||
2063 | get_desc_trans_len(desc)); | 2064 | get_desc_trans_len(desc)); |
2064 | return -1; | 2065 | return -1; |
2065 | } | 2066 | } |
@@ -2195,8 +2196,8 @@ static int journal_read_transaction(struct super_block *p_s_sb, | |||
2195 | brelse(d_bh); | 2196 | brelse(d_bh); |
2196 | kfree(log_blocks); | 2197 | kfree(log_blocks); |
2197 | kfree(real_blocks); | 2198 | kfree(real_blocks); |
2198 | reiserfs_warning(p_s_sb, | 2199 | reiserfs_warning(p_s_sb, "journal-1169", |
2199 | "journal-1169: kmalloc failed, unable to mount FS"); | 2200 | "kmalloc failed, unable to mount FS"); |
2200 | return -1; | 2201 | return -1; |
2201 | } | 2202 | } |
2202 | /* get all the buffer heads */ | 2203 | /* get all the buffer heads */ |
@@ -2218,15 +2219,18 @@ static int journal_read_transaction(struct super_block *p_s_sb, | |||
2218 | j_realblock[i - trans_half])); | 2219 | j_realblock[i - trans_half])); |
2219 | } | 2220 | } |
2220 | if (real_blocks[i]->b_blocknr > SB_BLOCK_COUNT(p_s_sb)) { | 2221 | if (real_blocks[i]->b_blocknr > SB_BLOCK_COUNT(p_s_sb)) { |
2221 | reiserfs_warning(p_s_sb, | 2222 | reiserfs_warning(p_s_sb, "journal-1207", |
2222 | "journal-1207: REPLAY FAILURE fsck required! Block to replay is outside of filesystem"); | 2223 | "REPLAY FAILURE fsck required! " |
2224 | "Block to replay is outside of " | ||
2225 | "filesystem"); | ||
2223 | goto abort_replay; | 2226 | goto abort_replay; |
2224 | } | 2227 | } |
2225 | /* make sure we don't try to replay onto log or reserved area */ | 2228 | /* make sure we don't try to replay onto log or reserved area */ |
2226 | if (is_block_in_log_or_reserved_area | 2229 | if (is_block_in_log_or_reserved_area |
2227 | (p_s_sb, real_blocks[i]->b_blocknr)) { | 2230 | (p_s_sb, real_blocks[i]->b_blocknr)) { |
2228 | reiserfs_warning(p_s_sb, | 2231 | reiserfs_warning(p_s_sb, "journal-1204", |
2229 | "journal-1204: REPLAY FAILURE fsck required! Trying to replay onto a log block"); | 2232 | "REPLAY FAILURE fsck required! " |
2233 | "Trying to replay onto a log block"); | ||
2230 | abort_replay: | 2234 | abort_replay: |
2231 | brelse_array(log_blocks, i); | 2235 | brelse_array(log_blocks, i); |
2232 | brelse_array(real_blocks, i); | 2236 | brelse_array(real_blocks, i); |
@@ -2242,8 +2246,9 @@ static int journal_read_transaction(struct super_block *p_s_sb, | |||
2242 | for (i = 0; i < get_desc_trans_len(desc); i++) { | 2246 | for (i = 0; i < get_desc_trans_len(desc); i++) { |
2243 | wait_on_buffer(log_blocks[i]); | 2247 | wait_on_buffer(log_blocks[i]); |
2244 | if (!buffer_uptodate(log_blocks[i])) { | 2248 | if (!buffer_uptodate(log_blocks[i])) { |
2245 | reiserfs_warning(p_s_sb, | 2249 | reiserfs_warning(p_s_sb, "journal-1212", |
2246 | "journal-1212: REPLAY FAILURE fsck required! buffer write failed"); | 2250 | "REPLAY FAILURE fsck required! " |
2251 | "buffer write failed"); | ||
2247 | brelse_array(log_blocks + i, | 2252 | brelse_array(log_blocks + i, |
2248 | get_desc_trans_len(desc) - i); | 2253 | get_desc_trans_len(desc) - i); |
2249 | brelse_array(real_blocks, get_desc_trans_len(desc)); | 2254 | 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 | for (i = 0; i < get_desc_trans_len(desc); i++) { | 2271 | for (i = 0; i < get_desc_trans_len(desc); i++) { |
2267 | wait_on_buffer(real_blocks[i]); | 2272 | wait_on_buffer(real_blocks[i]); |
2268 | if (!buffer_uptodate(real_blocks[i])) { | 2273 | if (!buffer_uptodate(real_blocks[i])) { |
2269 | reiserfs_warning(p_s_sb, | 2274 | reiserfs_warning(p_s_sb, "journal-1226", |
2270 | "journal-1226: REPLAY FAILURE, fsck required! buffer write failed"); | 2275 | "REPLAY FAILURE, fsck required! " |
2276 | "buffer write failed"); | ||
2271 | brelse_array(real_blocks + i, | 2277 | brelse_array(real_blocks + i, |
2272 | get_desc_trans_len(desc) - i); | 2278 | get_desc_trans_len(desc) - i); |
2273 | brelse(c_bh); | 2279 | brelse(c_bh); |
@@ -2418,8 +2424,8 @@ static int journal_read(struct super_block *p_s_sb) | |||
2418 | } | 2424 | } |
2419 | 2425 | ||
2420 | if (continue_replay && bdev_read_only(p_s_sb->s_bdev)) { | 2426 | if (continue_replay && bdev_read_only(p_s_sb->s_bdev)) { |
2421 | reiserfs_warning(p_s_sb, | 2427 | reiserfs_warning(p_s_sb, "clm-2076", |
2422 | "clm-2076: device is readonly, unable to replay log"); | 2428 | "device is readonly, unable to replay log"); |
2423 | return -1; | 2429 | return -1; |
2424 | } | 2430 | } |
2425 | 2431 | ||
@@ -2580,9 +2586,8 @@ static int release_journal_dev(struct super_block *super, | |||
2580 | } | 2586 | } |
2581 | 2587 | ||
2582 | if (result != 0) { | 2588 | if (result != 0) { |
2583 | reiserfs_warning(super, | 2589 | reiserfs_warning(super, "sh-457", |
2584 | "sh-457: release_journal_dev: Cannot release journal device: %i", | 2590 | "Cannot release journal device: %i", result); |
2585 | result); | ||
2586 | } | 2591 | } |
2587 | return result; | 2592 | return result; |
2588 | } | 2593 | } |
@@ -2612,7 +2617,7 @@ static int journal_init_dev(struct super_block *super, | |||
2612 | if (IS_ERR(journal->j_dev_bd)) { | 2617 | if (IS_ERR(journal->j_dev_bd)) { |
2613 | result = PTR_ERR(journal->j_dev_bd); | 2618 | result = PTR_ERR(journal->j_dev_bd); |
2614 | journal->j_dev_bd = NULL; | 2619 | journal->j_dev_bd = NULL; |
2615 | reiserfs_warning(super, "sh-458: journal_init_dev: " | 2620 | reiserfs_warning(super, "sh-458", |
2616 | "cannot init journal device '%s': %i", | 2621 | "cannot init journal device '%s': %i", |
2617 | __bdevname(jdev, b), result); | 2622 | __bdevname(jdev, b), result); |
2618 | return result; | 2623 | return result; |
@@ -2676,16 +2681,16 @@ static int check_advise_trans_params(struct super_block *p_s_sb, | |||
2676 | journal->j_trans_max < JOURNAL_TRANS_MIN_DEFAULT / ratio || | 2681 | journal->j_trans_max < JOURNAL_TRANS_MIN_DEFAULT / ratio || |
2677 | SB_ONDISK_JOURNAL_SIZE(p_s_sb) / journal->j_trans_max < | 2682 | SB_ONDISK_JOURNAL_SIZE(p_s_sb) / journal->j_trans_max < |
2678 | JOURNAL_MIN_RATIO) { | 2683 | JOURNAL_MIN_RATIO) { |
2679 | reiserfs_warning(p_s_sb, | 2684 | reiserfs_warning(p_s_sb, "sh-462", |
2680 | "sh-462: bad transaction max size (%u). FSCK?", | 2685 | "bad transaction max size (%u). " |
2681 | journal->j_trans_max); | 2686 | "FSCK?", journal->j_trans_max); |
2682 | return 1; | 2687 | return 1; |
2683 | } | 2688 | } |
2684 | if (journal->j_max_batch != (journal->j_trans_max) * | 2689 | if (journal->j_max_batch != (journal->j_trans_max) * |
2685 | JOURNAL_MAX_BATCH_DEFAULT/JOURNAL_TRANS_MAX_DEFAULT) { | 2690 | JOURNAL_MAX_BATCH_DEFAULT/JOURNAL_TRANS_MAX_DEFAULT) { |
2686 | reiserfs_warning(p_s_sb, | 2691 | reiserfs_warning(p_s_sb, "sh-463", |
2687 | "sh-463: bad transaction max batch (%u). FSCK?", | 2692 | "bad transaction max batch (%u). " |
2688 | journal->j_max_batch); | 2693 | "FSCK?", journal->j_max_batch); |
2689 | return 1; | 2694 | return 1; |
2690 | } | 2695 | } |
2691 | } else { | 2696 | } else { |
@@ -2693,9 +2698,11 @@ static int check_advise_trans_params(struct super_block *p_s_sb, | |||
2693 | The file system was created by old version | 2698 | The file system was created by old version |
2694 | of mkreiserfs, so some fields contain zeros, | 2699 | of mkreiserfs, so some fields contain zeros, |
2695 | and we need to advise proper values for them */ | 2700 | and we need to advise proper values for them */ |
2696 | if (p_s_sb->s_blocksize != REISERFS_STANDARD_BLKSIZE) | 2701 | if (p_s_sb->s_blocksize != REISERFS_STANDARD_BLKSIZE) { |
2697 | reiserfs_panic(p_s_sb, "sh-464: bad blocksize (%u)", | 2702 | reiserfs_warning(p_s_sb, "sh-464", "bad blocksize (%u)", |
2698 | p_s_sb->s_blocksize); | 2703 | p_s_sb->s_blocksize); |
2704 | return 1; | ||
2705 | } | ||
2699 | journal->j_trans_max = JOURNAL_TRANS_MAX_DEFAULT; | 2706 | journal->j_trans_max = JOURNAL_TRANS_MAX_DEFAULT; |
2700 | journal->j_max_batch = JOURNAL_MAX_BATCH_DEFAULT; | 2707 | journal->j_max_batch = JOURNAL_MAX_BATCH_DEFAULT; |
2701 | journal->j_max_commit_age = JOURNAL_MAX_COMMIT_AGE; | 2708 | 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 | 2726 | ||
2720 | journal = SB_JOURNAL(p_s_sb) = vmalloc(sizeof(struct reiserfs_journal)); | 2727 | journal = SB_JOURNAL(p_s_sb) = vmalloc(sizeof(struct reiserfs_journal)); |
2721 | if (!journal) { | 2728 | if (!journal) { |
2722 | reiserfs_warning(p_s_sb, | 2729 | reiserfs_warning(p_s_sb, "journal-1256", |
2723 | "journal-1256: unable to get memory for journal structure"); | 2730 | "unable to get memory for journal structure"); |
2724 | return 1; | 2731 | return 1; |
2725 | } | 2732 | } |
2726 | memset(journal, 0, sizeof(struct reiserfs_journal)); | 2733 | 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 | if (!SB_ONDISK_JOURNAL_DEVICE(p_s_sb) && | 2756 | if (!SB_ONDISK_JOURNAL_DEVICE(p_s_sb) && |
2750 | (SB_JOURNAL_1st_RESERVED_BLOCK(p_s_sb) + | 2757 | (SB_JOURNAL_1st_RESERVED_BLOCK(p_s_sb) + |
2751 | SB_ONDISK_JOURNAL_SIZE(p_s_sb) > p_s_sb->s_blocksize * 8)) { | 2758 | SB_ONDISK_JOURNAL_SIZE(p_s_sb) > p_s_sb->s_blocksize * 8)) { |
2752 | reiserfs_warning(p_s_sb, | 2759 | reiserfs_warning(p_s_sb, "journal-1393", |
2753 | "journal-1393: journal does not fit for area " | 2760 | "journal does not fit for area addressed " |
2754 | "addressed by first of bitmap blocks. It starts at " | 2761 | "by first of bitmap blocks. It starts at " |
2755 | "%u and its size is %u. Block size %ld", | 2762 | "%u and its size is %u. Block size %ld", |
2756 | SB_JOURNAL_1st_RESERVED_BLOCK(p_s_sb), | 2763 | SB_JOURNAL_1st_RESERVED_BLOCK(p_s_sb), |
2757 | SB_ONDISK_JOURNAL_SIZE(p_s_sb), | 2764 | 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 | } | 2767 | } |
2761 | 2768 | ||
2762 | if (journal_init_dev(p_s_sb, journal, j_dev_name) != 0) { | 2769 | if (journal_init_dev(p_s_sb, journal, j_dev_name) != 0) { |
2763 | reiserfs_warning(p_s_sb, | 2770 | reiserfs_warning(p_s_sb, "sh-462", |
2764 | "sh-462: unable to initialize jornal device"); | 2771 | "unable to initialize jornal device"); |
2765 | goto free_and_return; | 2772 | goto free_and_return; |
2766 | } | 2773 | } |
2767 | 2774 | ||
@@ -2772,8 +2779,8 @@ int journal_init(struct super_block *p_s_sb, const char *j_dev_name, | |||
2772 | SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb) + | 2779 | SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb) + |
2773 | SB_ONDISK_JOURNAL_SIZE(p_s_sb)); | 2780 | SB_ONDISK_JOURNAL_SIZE(p_s_sb)); |
2774 | if (!bhjh) { | 2781 | if (!bhjh) { |
2775 | reiserfs_warning(p_s_sb, | 2782 | reiserfs_warning(p_s_sb, "sh-459", |
2776 | "sh-459: unable to read journal header"); | 2783 | "unable to read journal header"); |
2777 | goto free_and_return; | 2784 | goto free_and_return; |
2778 | } | 2785 | } |
2779 | jh = (struct reiserfs_journal_header *)(bhjh->b_data); | 2786 | 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 | if (is_reiserfs_jr(rs) | 2789 | if (is_reiserfs_jr(rs) |
2783 | && (le32_to_cpu(jh->jh_journal.jp_journal_magic) != | 2790 | && (le32_to_cpu(jh->jh_journal.jp_journal_magic) != |
2784 | sb_jp_journal_magic(rs))) { | 2791 | sb_jp_journal_magic(rs))) { |
2785 | reiserfs_warning(p_s_sb, | 2792 | reiserfs_warning(p_s_sb, "sh-460", |
2786 | "sh-460: journal header magic %x " | 2793 | "journal header magic %x (device %s) does " |
2787 | "(device %s) does not match to magic found in super " | 2794 | "not match to magic found in super block %x", |
2788 | "block %x", jh->jh_journal.jp_journal_magic, | 2795 | jh->jh_journal.jp_journal_magic, |
2789 | bdevname(journal->j_dev_bd, b), | 2796 | bdevname(journal->j_dev_bd, b), |
2790 | sb_jp_journal_magic(rs)); | 2797 | sb_jp_journal_magic(rs)); |
2791 | brelse(bhjh); | 2798 | brelse(bhjh); |
@@ -2852,7 +2859,7 @@ int journal_init(struct super_block *p_s_sb, const char *j_dev_name, | |||
2852 | journal->j_must_wait = 0; | 2859 | journal->j_must_wait = 0; |
2853 | 2860 | ||
2854 | if (journal->j_cnode_free == 0) { | 2861 | if (journal->j_cnode_free == 0) { |
2855 | reiserfs_warning(p_s_sb, "journal-2004: Journal cnode memory " | 2862 | reiserfs_warning(p_s_sb, "journal-2004", "Journal cnode memory " |
2856 | "allocation failed (%ld bytes). Journal is " | 2863 | "allocation failed (%ld bytes). Journal is " |
2857 | "too large for available memory. Usually " | 2864 | "too large for available memory. Usually " |
2858 | "this is due to a journal that is too large.", | 2865 | "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 | jl = journal->j_current_jl; | 2871 | jl = journal->j_current_jl; |
2865 | jl->j_list_bitmap = get_list_bitmap(p_s_sb, jl); | 2872 | jl->j_list_bitmap = get_list_bitmap(p_s_sb, jl); |
2866 | if (!jl->j_list_bitmap) { | 2873 | if (!jl->j_list_bitmap) { |
2867 | reiserfs_warning(p_s_sb, | 2874 | reiserfs_warning(p_s_sb, "journal-2005", |
2868 | "journal-2005, get_list_bitmap failed for journal list 0"); | 2875 | "get_list_bitmap failed for journal list 0"); |
2869 | goto free_and_return; | 2876 | goto free_and_return; |
2870 | } | 2877 | } |
2871 | if (journal_read(p_s_sb) < 0) { | 2878 | if (journal_read(p_s_sb) < 0) { |
2872 | reiserfs_warning(p_s_sb, "Replay Failure, unable to mount"); | 2879 | reiserfs_warning(p_s_sb, "reiserfs-2006", |
2880 | "Replay Failure, unable to mount"); | ||
2873 | goto free_and_return; | 2881 | goto free_and_return; |
2874 | } | 2882 | } |
2875 | 2883 | ||
@@ -3196,16 +3204,17 @@ int journal_begin(struct reiserfs_transaction_handle *th, | |||
3196 | cur_th->t_refcount++; | 3204 | cur_th->t_refcount++; |
3197 | memcpy(th, cur_th, sizeof(*th)); | 3205 | memcpy(th, cur_th, sizeof(*th)); |
3198 | if (th->t_refcount <= 1) | 3206 | if (th->t_refcount <= 1) |
3199 | reiserfs_warning(p_s_sb, | 3207 | reiserfs_warning(p_s_sb, "reiserfs-2005", |
3200 | "BAD: refcount <= 1, but journal_info != 0"); | 3208 | "BAD: refcount <= 1, but " |
3209 | "journal_info != 0"); | ||
3201 | return 0; | 3210 | return 0; |
3202 | } else { | 3211 | } else { |
3203 | /* we've ended up with a handle from a different filesystem. | 3212 | /* we've ended up with a handle from a different filesystem. |
3204 | ** save it and restore on journal_end. This should never | 3213 | ** save it and restore on journal_end. This should never |
3205 | ** really happen... | 3214 | ** really happen... |
3206 | */ | 3215 | */ |
3207 | reiserfs_warning(p_s_sb, | 3216 | reiserfs_warning(p_s_sb, "clm-2100", |
3208 | "clm-2100: nesting info a different FS"); | 3217 | "nesting info a different FS"); |
3209 | th->t_handle_save = current->journal_info; | 3218 | th->t_handle_save = current->journal_info; |
3210 | current->journal_info = th; | 3219 | current->journal_info = th; |
3211 | } | 3220 | } |
@@ -3266,7 +3275,8 @@ int journal_mark_dirty(struct reiserfs_transaction_handle *th, | |||
3266 | ** could get to disk too early. NOT GOOD. | 3275 | ** could get to disk too early. NOT GOOD. |
3267 | */ | 3276 | */ |
3268 | if (!prepared || buffer_dirty(bh)) { | 3277 | if (!prepared || buffer_dirty(bh)) { |
3269 | reiserfs_warning(p_s_sb, "journal-1777: buffer %llu bad state " | 3278 | reiserfs_warning(p_s_sb, "journal-1777", |
3279 | "buffer %llu bad state " | ||
3270 | "%cPREPARED %cLOCKED %cDIRTY %cJDIRTY_WAIT", | 3280 | "%cPREPARED %cLOCKED %cDIRTY %cJDIRTY_WAIT", |
3271 | (unsigned long long)bh->b_blocknr, | 3281 | (unsigned long long)bh->b_blocknr, |
3272 | prepared ? ' ' : '!', | 3282 | prepared ? ' ' : '!', |
@@ -3276,8 +3286,8 @@ int journal_mark_dirty(struct reiserfs_transaction_handle *th, | |||
3276 | } | 3286 | } |
3277 | 3287 | ||
3278 | if (atomic_read(&(journal->j_wcount)) <= 0) { | 3288 | if (atomic_read(&(journal->j_wcount)) <= 0) { |
3279 | reiserfs_warning(p_s_sb, | 3289 | reiserfs_warning(p_s_sb, "journal-1409", |
3280 | "journal-1409: journal_mark_dirty returning because j_wcount was %d", | 3290 | "returning because j_wcount was %d", |
3281 | atomic_read(&(journal->j_wcount))); | 3291 | atomic_read(&(journal->j_wcount))); |
3282 | return 1; | 3292 | return 1; |
3283 | } | 3293 | } |
@@ -3342,8 +3352,8 @@ int journal_end(struct reiserfs_transaction_handle *th, | |||
3342 | struct super_block *p_s_sb, unsigned long nblocks) | 3352 | struct super_block *p_s_sb, unsigned long nblocks) |
3343 | { | 3353 | { |
3344 | if (!current->journal_info && th->t_refcount > 1) | 3354 | if (!current->journal_info && th->t_refcount > 1) |
3345 | reiserfs_warning(p_s_sb, "REISER-NESTING: th NULL, refcount %d", | 3355 | reiserfs_warning(p_s_sb, "REISER-NESTING", |
3346 | th->t_refcount); | 3356 | "th NULL, refcount %d", th->t_refcount); |
3347 | 3357 | ||
3348 | if (!th->t_trans_id) { | 3358 | if (!th->t_trans_id) { |
3349 | WARN_ON(1); | 3359 | WARN_ON(1); |
@@ -3413,8 +3423,8 @@ static int remove_from_transaction(struct super_block *p_s_sb, | |||
3413 | clear_buffer_journal_test(bh); | 3423 | clear_buffer_journal_test(bh); |
3414 | put_bh(bh); | 3424 | put_bh(bh); |
3415 | if (atomic_read(&(bh->b_count)) < 0) { | 3425 | if (atomic_read(&(bh->b_count)) < 0) { |
3416 | reiserfs_warning(p_s_sb, | 3426 | reiserfs_warning(p_s_sb, "journal-1752", |
3417 | "journal-1752: remove from trans, b_count < 0"); | 3427 | "b_count < 0"); |
3418 | } | 3428 | } |
3419 | ret = 1; | 3429 | ret = 1; |
3420 | } | 3430 | } |
@@ -3734,7 +3744,8 @@ int journal_mark_freed(struct reiserfs_transaction_handle *th, | |||
3734 | if (atomic_read | 3744 | if (atomic_read |
3735 | (&(cn->bh->b_count)) < 0) { | 3745 | (&(cn->bh->b_count)) < 0) { |
3736 | reiserfs_warning(p_s_sb, | 3746 | reiserfs_warning(p_s_sb, |
3737 | "journal-2138: cn->bh->b_count < 0"); | 3747 | "journal-2138", |
3748 | "cn->bh->b_count < 0"); | ||
3738 | } | 3749 | } |
3739 | } | 3750 | } |
3740 | if (cn->jlist) { /* since we are clearing the bh, we MUST dec nonzerolen */ | 3751 | 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 | clear_buffer_journaled(cn->bh); | 4148 | clear_buffer_journaled(cn->bh); |
4138 | } else { | 4149 | } else { |
4139 | /* JDirty cleared sometime during transaction. don't log this one */ | 4150 | /* JDirty cleared sometime during transaction. don't log this one */ |
4140 | reiserfs_warning(p_s_sb, | 4151 | reiserfs_warning(p_s_sb, "journal-2048", |
4141 | "journal-2048: do_journal_end: BAD, buffer in journal hash, but not JDirty!"); | 4152 | "BAD, buffer in journal hash, " |
4153 | "but not JDirty!"); | ||
4142 | brelse(cn->bh); | 4154 | brelse(cn->bh); |
4143 | } | 4155 | } |
4144 | next = cn->next; | 4156 | next = cn->next; |