[PATCH] JBD: Fix JBD warnings when compiling with CONFIG_JBD_DEBUG



From: Jose R. Santos <jrs@xxxxxxxxxx>

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@xxxxxxxxxx>
--

fs/ext3/inode.c | 2 +-
fs/jbd/recovery.c | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c
index de4e316..f5b0e79 100644
--- a/fs/ext3/inode.c
+++ b/fs/ext3/inode.c
@@ -2887,7 +2887,7 @@ int ext3_write_inode(struct inode *inode, int wait)
return 0;

if (ext3_journal_current_handle()) {
- jbd_debug(0, "called recursively, non-PF_MEMALLOC!\n");
+ jbd_debug(1, "called recursively, non-PF_MEMALLOC!\n");
dump_stack();
return -EIO;
}
diff --git a/fs/jbd/recovery.c b/fs/jbd/recovery.c
index 2a5f4b8..c5d9694 100644
--- a/fs/jbd/recovery.c
+++ b/fs/jbd/recovery.c
@@ -250,10 +250,10 @@ int journal_recover(journal_t *journal)
if (!err)
err = do_one_pass(journal, &info, PASS_REPLAY);

- jbd_debug(0, "JBD: recovery, exit status %d, "
+ jbd_debug(1, "JBD: recovery, exit status %d, "
"recovered transactions %u to %u\n",
err, info.start_transaction, info.end_transaction);
- jbd_debug(0, "JBD: Replayed %d and revoked %d/%d blocks\n",
+ jbd_debug(1, "JBD: Replayed %d and revoked %d/%d blocks\n",
info.nr_replays, info.nr_revoke_hits, info.nr_revokes);

/* Restart the log at the next transaction ID, thus invalidating
@@ -297,7 +297,7 @@ int journal_skip_recovery(journal_t *journal)
#ifdef CONFIG_JBD_DEBUG
int dropped = info.end_transaction - be32_to_cpu(sb->s_sequence);
#endif
- jbd_debug(0,
+ jbd_debug(1,
"JBD: ignoring %d transaction%s from the journal.\n",
dropped, (dropped == 1) ? "" : "s");
journal->j_transaction_sequence = ++info.end_transaction;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • [git pull for 2.6.22-rc4 - resend] kbuild: fix sh64 section mismatch problems
    ... Please apply following 2 liners fix. ... It will fix a lot of false section mismatch warnings on sh64 and ... Subject: kbuild: fix sh64 section mismatch problems ... Silence the warnings by allowing references from .init.text to .cranges. ...
    (Linux-Kernel)
  • [PATCH for -rc] kbuild: fix sh64 section mismatch problems
    ... Please apply following 2 liners fix. ... It will fix a lot of false section mismatch warnings on sh64 and ... Subject: kbuild: fix sh64 section mismatch problems ... Silence the warnings by allowing references from .init.text to .cranges. ...
    (Linux-Kernel)
  • [patch/backport] CFS scheduler, -v24, for v2.6.24-rc3, v2.6.23.8, v2.6.22.13, v2.6.21.7
    ... here is release -v24 of the CFS scheduler patch. ... As usual, any sort of feedback, bugreport, fix and suggestion is more ... Make scheduler debug file operations const ... clean up schedstat block in dequeue_entity ...
    (Linux-Kernel)
  • Re: Visual C++ Tools Refresh ready today
    ... generated the same errors as found in my debug build. ... Where will the fix be made available so that I won't be ... re-downloading the original Tools Refresh? ...
    (microsoft.public.dotnet.languages.vc)
  • Linux 2.6.24-rc6
    ... it's pretty much a lot of small fixes (maybe not ... fix write batch start point ... Remove assembler warnings on head.S ... libata-acpi: improve ACPI disabling ...
    (Linux-Kernel)

Loading