diff options
author | Theodore Ts'o <tytso@mit.edu> | 2014-03-12 16:38:03 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2014-03-12 16:38:03 -0400 |
commit | 66a4cb187b92ca8663203fe8fda621e6585a2a00 (patch) | |
tree | de342428a303fe10842e04b81514be5cf582f7db /fs/jbd2 | |
parent | 0bfea8118d8e4f6aeb476511350d649e8dcb0ce8 (diff) |
jbd2: improve error messages for inconsistent journal heads
Fix up error messages printed when the transaction pointers in a
journal head are inconsistent. This improves the error messages which
are printed when running xfstests generic/068 in data=journal mode.
See the bug report at: https://bugzilla.kernel.org/show_bug.cgi?id=60786
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/jbd2')
-rw-r--r-- | fs/jbd2/transaction.c | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c index d999b1f6847c..38cfcf5f6fce 100644 --- a/fs/jbd2/transaction.c +++ b/fs/jbd2/transaction.c | |||
@@ -1313,7 +1313,7 @@ int jbd2_journal_dirty_metadata(handle_t *handle, struct buffer_head *bh) | |||
1313 | journal->j_running_transaction)) { | 1313 | journal->j_running_transaction)) { |
1314 | printk(KERN_ERR "JBD2: %s: " | 1314 | printk(KERN_ERR "JBD2: %s: " |
1315 | "jh->b_transaction (%llu, %p, %u) != " | 1315 | "jh->b_transaction (%llu, %p, %u) != " |
1316 | "journal->j_running_transaction (%p, %u)", | 1316 | "journal->j_running_transaction (%p, %u)\n", |
1317 | journal->j_devname, | 1317 | journal->j_devname, |
1318 | (unsigned long long) bh->b_blocknr, | 1318 | (unsigned long long) bh->b_blocknr, |
1319 | jh->b_transaction, | 1319 | jh->b_transaction, |
@@ -1336,30 +1336,25 @@ int jbd2_journal_dirty_metadata(handle_t *handle, struct buffer_head *bh) | |||
1336 | */ | 1336 | */ |
1337 | if (jh->b_transaction != transaction) { | 1337 | if (jh->b_transaction != transaction) { |
1338 | JBUFFER_TRACE(jh, "already on other transaction"); | 1338 | JBUFFER_TRACE(jh, "already on other transaction"); |
1339 | if (unlikely(jh->b_transaction != | 1339 | if (unlikely(((jh->b_transaction != |
1340 | journal->j_committing_transaction)) { | 1340 | journal->j_committing_transaction)) || |
1341 | printk(KERN_ERR "JBD2: %s: " | 1341 | (jh->b_next_transaction != transaction))) { |
1342 | "jh->b_transaction (%llu, %p, %u) != " | 1342 | printk(KERN_ERR "jbd2_journal_dirty_metadata: %s: " |
1343 | "journal->j_committing_transaction (%p, %u)", | 1343 | "bad jh for block %llu: " |
1344 | "transaction (%p, %u), " | ||
1345 | "jh->b_transaction (%p, %u), " | ||
1346 | "jh->b_next_transaction (%p, %u), jlist %u\n", | ||
1344 | journal->j_devname, | 1347 | journal->j_devname, |
1345 | (unsigned long long) bh->b_blocknr, | 1348 | (unsigned long long) bh->b_blocknr, |
1349 | transaction, transaction->t_tid, | ||
1346 | jh->b_transaction, | 1350 | jh->b_transaction, |
1347 | jh->b_transaction ? jh->b_transaction->t_tid : 0, | 1351 | jh->b_transaction ? |
1348 | journal->j_committing_transaction, | 1352 | jh->b_transaction->t_tid : 0, |
1349 | journal->j_committing_transaction ? | ||
1350 | journal->j_committing_transaction->t_tid : 0); | ||
1351 | ret = -EINVAL; | ||
1352 | } | ||
1353 | if (unlikely(jh->b_next_transaction != transaction)) { | ||
1354 | printk(KERN_ERR "JBD2: %s: " | ||
1355 | "jh->b_next_transaction (%llu, %p, %u) != " | ||
1356 | "transaction (%p, %u)", | ||
1357 | journal->j_devname, | ||
1358 | (unsigned long long) bh->b_blocknr, | ||
1359 | jh->b_next_transaction, | 1353 | jh->b_next_transaction, |
1360 | jh->b_next_transaction ? | 1354 | jh->b_next_transaction ? |
1361 | jh->b_next_transaction->t_tid : 0, | 1355 | jh->b_next_transaction->t_tid : 0, |
1362 | transaction, transaction->t_tid); | 1356 | jh->b_jlist); |
1357 | WARN_ON(1); | ||
1363 | ret = -EINVAL; | 1358 | ret = -EINVAL; |
1364 | } | 1359 | } |
1365 | /* And this case is illegal: we can't reuse another | 1360 | /* And this case is illegal: we can't reuse another |