Commit 9ad163ae0df8a3adab6d521475142392e3efb7a6

Authored by Jose R. Santos
Committed by Linus Torvalds
1 parent 7a266e75cf

JBD: Fix JBD warnings when compiling with CONFIG_JBD_DEBUG

Note from Mingming's JBD2 fix:

Noticed all warnings are occurs when the debug level is 0.  Then found the
"jbd2: Move jbd2-debug file to debugfs" patch
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0f49d5d019afa4e94253bfc92f0daca3badb990b

changed the jbd2_journal_enable_debug from int type to u8, makes the
jbd_debug comparision is always true when the debugging level is 0.  Thus
the compile warning occurs.

Thought about changing the jbd2_journal_enable_debug data type back to int,
but can't, because the jbd2-debug is moved to debug fs, where calling
debugfs_create_u8() to create the debugfs entry needs the value to be u8
type.

Even if we changed the data type back to int, the code is still buggy,
kernel should not print jbd2 debug message if the jbd2_journal_enable_debug
is set to 0.  But this is not the case.

The fix is change the level of debugging to 1.  The same should fixed in
ext3/JBD, but currently ext3 jbd-debug via /proc fs is broken, so we
probably should fix it all together.

Signed-off-by: Jose R. Santos <jrs@us.ibm.com>
Cc: <linux-ext4@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 2 changed files with 4 additions and 4 deletions Side-by-side Diff

... ... @@ -2954,7 +2954,7 @@
2954 2954 return 0;
2955 2955  
2956 2956 if (ext3_journal_current_handle()) {
2957   - jbd_debug(0, "called recursively, non-PF_MEMALLOC!\n");
  2957 + jbd_debug(1, "called recursively, non-PF_MEMALLOC!\n");
2958 2958 dump_stack();
2959 2959 return -EIO;
2960 2960 }
... ... @@ -250,10 +250,10 @@
250 250 if (!err)
251 251 err = do_one_pass(journal, &info, PASS_REPLAY);
252 252  
253   - jbd_debug(0, "JBD: recovery, exit status %d, "
  253 + jbd_debug(1, "JBD: recovery, exit status %d, "
254 254 "recovered transactions %u to %u\n",
255 255 err, info.start_transaction, info.end_transaction);
256   - jbd_debug(0, "JBD: Replayed %d and revoked %d/%d blocks\n",
  256 + jbd_debug(1, "JBD: Replayed %d and revoked %d/%d blocks\n",
257 257 info.nr_replays, info.nr_revoke_hits, info.nr_revokes);
258 258  
259 259 /* Restart the log at the next transaction ID, thus invalidating
... ... @@ -297,7 +297,7 @@
297 297 #ifdef CONFIG_JBD_DEBUG
298 298 int dropped = info.end_transaction - be32_to_cpu(sb->s_sequence);
299 299 #endif
300   - jbd_debug(0,
  300 + jbd_debug(1,
301 301 "JBD: ignoring %d transaction%s from the journal.\n",
302 302 dropped, (dropped == 1) ? "" : "s");
303 303 journal->j_transaction_sequence = ++info.end_transaction;