diff options
author | Paul Gortmaker <paul.gortmaker@windriver.com> | 2013-08-01 15:01:08 -0400 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2013-08-09 04:49:00 -0400 |
commit | e99a03c6f50a699d63b5751e3e88f84e43b037a7 (patch) | |
tree | c7f698cce69e90ada770e69502cd0742d84c9324 /fs | |
parent | a91de85247dfa74a3f8a161e24ce21f23432cbda (diff) |
jbd: use a single printk for jbd_debug()
Backport of jbd2 commit 169f1a2a87aae44034da4b9f81be1683d33de6d0
("jbd2: use a single printk for jbd_debug()")
Since the jbd_debug() is implemented with two separate printk()
calls, it can lead to corrupted and misleading debug output like
the following (see lines marked with "*"):
[ 290.339362] (fs/jbd2/journal.c, 203): kjournald2: kjournald2 wakes
[ 290.339365] (fs/jbd2/journal.c, 155): kjournald2: commit_sequence=42103, commit_request=42104
[ 290.339369] (fs/jbd2/journal.c, 158): kjournald2: OK, requests differ
[* 290.339376] (fs/jbd2/journal.c, 648): jbd2_log_wait_commit:
[* 290.339379] (fs/jbd2/commit.c, 370): jbd2_journal_commit_transaction: JBD2: want 42104, j_commit_sequence=42103
[* 290.339382] JBD2: starting commit of transaction 42104
[ 290.339410] (fs/jbd2/revoke.c, 566): jbd2_journal_write_revoke_records: Wrote 0 revoke records
[ 290.376555] (fs/jbd2/commit.c, 1088): jbd2_journal_commit_transaction: JBD2: commit 42104 complete, head 42079
i.e. the debug output from log_wait_commit and journal_commit_transaction
have become interleaved. The output should have been:
(fs/jbd2/journal.c, 648): jbd2_log_wait_commit: JBD2: want 42104, j_commit_sequence=42103
(fs/jbd2/commit.c, 370): jbd2_journal_commit_transaction: JBD2: starting commit of transaction 42104
It is expected that this is not easy to replicate -- I was only able
to cause it on preempt-rt kernels, and even then only under heavy
I/O load.
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/jbd/journal.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/fs/jbd/journal.c b/fs/jbd/journal.c index 6510d6355729..2d04f9afafd7 100644 --- a/fs/jbd/journal.c +++ b/fs/jbd/journal.c | |||
@@ -90,6 +90,24 @@ static int journal_convert_superblock_v1(journal_t *, journal_superblock_t *); | |||
90 | static void __journal_abort_soft (journal_t *journal, int errno); | 90 | static void __journal_abort_soft (journal_t *journal, int errno); |
91 | static const char *journal_dev_name(journal_t *journal, char *buffer); | 91 | static const char *journal_dev_name(journal_t *journal, char *buffer); |
92 | 92 | ||
93 | #ifdef CONFIG_JBD_DEBUG | ||
94 | void __jbd_debug(int level, const char *file, const char *func, | ||
95 | unsigned int line, const char *fmt, ...) | ||
96 | { | ||
97 | struct va_format vaf; | ||
98 | va_list args; | ||
99 | |||
100 | if (level > journal_enable_debug) | ||
101 | return; | ||
102 | va_start(args, fmt); | ||
103 | vaf.fmt = fmt; | ||
104 | vaf.va = &args; | ||
105 | printk(KERN_DEBUG "%s: (%s, %u): %pV\n", file, func, line, &vaf); | ||
106 | va_end(args); | ||
107 | } | ||
108 | EXPORT_SYMBOL(__jbd_debug); | ||
109 | #endif | ||
110 | |||
93 | /* | 111 | /* |
94 | * Helper function used to manage commit timeouts | 112 | * Helper function used to manage commit timeouts |
95 | */ | 113 | */ |