]> git.karo-electronics.de Git - karo-tx-linux.git/commit
jbd2: add debugging information to jbd2_journal_dirty_metadata()
authorTheodore Ts'o <tytso@mit.edu>
Fri, 26 Aug 2011 02:27:36 +0000 (22:27 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 26 Aug 2011 02:27:36 +0000 (22:27 -0400)
commit471b04bc9739e72de7054831810dd2fa27b37273
tree47a2f15547acd3d4f4c98b03fa18d0320a6ae498
parent377f9b45ea4006b56fd9e4b8f46c41d9baf0f7eb
jbd2: add debugging information to jbd2_journal_dirty_metadata()

Add debugging information in case jbd2_journal_dirty_metadata() is
called with a buffer_head which didn't have
jbd2_journal_get_write_access() called on it, or if the journal_head
has the wrong transaction in it.  In addition, return an error code.
This won't change anything for ocfs2, which will BUG_ON() the non-zero
exit code.

For ext4, the caller of this function is ext4_handle_dirty_metadata(),
and on seeing a non-zero return code, will call
ext4_journal_abort_handle(), which will print the function and line
number of the calling function that screwed up and abort the journal.
This will allow us to recover instead of bug halting, which is better
from a robustness and reliability point of view.

Cc: curtw@google.com
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs/jbd2/transaction.c