* new ext4 build warnings
@ 2007-07-18 21:37 Jeff Garzik
2007-07-19 0:59 ` Mingming Cao
2007-07-19 3:07 ` [PATCH] fix ext4/JBD2 " Mingming Cao
0 siblings, 2 replies; 3+ messages in thread
From: Jeff Garzik @ 2007-07-18 21:37 UTC (permalink / raw)
To: Theodore Tso; +Cc: Linux Kernel Mailing List, linux-fsdevel, Andrew Morton
It seems jbd_debug() might need modification:
fs/ext4/inode.c: In function ‘ext4_write_inode’:
fs/ext4/inode.c:2906: warning: comparison is always true due to limited
range of data type
fs/jbd2/recovery.c: In function ‘jbd2_journal_recover’:
fs/jbd2/recovery.c:254: warning: comparison is always true due to
limited range of data type
fs/jbd2/recovery.c:257: warning: comparison is always true due to
limited range of data type
fs/jbd2/recovery.c: In function ‘jbd2_journal_skip_recovery’:
fs/jbd2/recovery.c:301: warning: comparison is always true due to
limited range of data type
I'm surprised this was not noticed in a test build before pushing upstream.
Jeff
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: new ext4 build warnings
2007-07-18 21:37 new ext4 build warnings Jeff Garzik
@ 2007-07-19 0:59 ` Mingming Cao
2007-07-19 3:07 ` [PATCH] fix ext4/JBD2 " Mingming Cao
1 sibling, 0 replies; 3+ messages in thread
From: Mingming Cao @ 2007-07-19 0:59 UTC (permalink / raw)
To: Jeff Garzik
Cc: Theodore Tso, Linux Kernel Mailing List, linux-fsdevel,
Andrew Morton
On Wed, 2007-07-18 at 17:37 -0400, Jeff Garzik wrote:
> It seems jbd_debug() might need modification:
>
> fs/ext4/inode.c: In function ‘ext4_write_inode’:
> fs/ext4/inode.c:2906: warning: comparison is always true due to limited
> range of data type
>
> fs/jbd2/recovery.c: In function ‘jbd2_journal_recover’:
> fs/jbd2/recovery.c:254: warning: comparison is always true due to
> limited range of data type
> fs/jbd2/recovery.c:257: warning: comparison is always true due to
> limited range of data type
>
> fs/jbd2/recovery.c: In function ‘jbd2_journal_skip_recovery’:
> fs/jbd2/recovery.c:301: warning: comparison is always true due to
> limited range of data type
>
> I'm surprised this was not noticed in a test build before pushing upstream.
>
Hmm, I am not sure what happened. I get the compile warning on linus
latest git tree, but could not get the same compile warning on Ted's
ext4 git tree.
In both build CONFIG_JBD2_DEBUG and DEBUG_FS is enabled.
Mingming
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] fix ext4/JBD2 build warnings
2007-07-18 21:37 new ext4 build warnings Jeff Garzik
2007-07-19 0:59 ` Mingming Cao
@ 2007-07-19 3:07 ` Mingming Cao
1 sibling, 0 replies; 3+ messages in thread
From: Mingming Cao @ 2007-07-19 3:07 UTC (permalink / raw)
To: Jeff Garzik, Linus Torvalds
Cc: Theodore Tso, Linux Kernel Mailing List, linux-fsdevel,
Andrew Morton, jrs
On Wed, 2007-07-18 at 17:37 -0400, Jeff Garzik wrote:
> It seems jbd_debug() might need modification:
>
Looking at the current linus-git tree jbd_debug() define in
include/linux/jbd2.h
extern u8 journal_enable_debug;
#define jbd_debug(n, f, a...) \
do { \
if ((n) <= journal_enable_debug) { \
printk (KERN_DEBUG "(%s, %d): %s: ", \
__FILE__, __LINE__, __FUNCTION__); \
printk (f, ## a); \
} \
} while (0)
> fs/ext4/inode.c: In function ‘ext4_write_inode’:
> fs/ext4/inode.c:2906: warning: comparison is always true due to limited
> range of data type
>
> fs/jbd2/recovery.c: In function ‘jbd2_journal_recover’:
> fs/jbd2/recovery.c:254: warning: comparison is always true due to
> limited range of data type
> fs/jbd2/recovery.c:257: warning: comparison is always true due to
> limited range of data type
>
> fs/jbd2/recovery.c: In function ‘jbd2_journal_skip_recovery’:
> fs/jbd2/recovery.c:301: warning: comparison is always true due to
> limited range of data type
>
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: Mingming Cao <cmm@us.ibm.com>
---
fs/ext4/inode.c | 2 +-
fs/jbd2/recovery.c | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
Index: linux-2.6.22/fs/ext4/inode.c
===================================================================
--- linux-2.6.22.orig/fs/ext4/inode.c 2007-07-18 19:23:58.000000000 -0700
+++ linux-2.6.22/fs/ext4/inode.c 2007-07-18 19:25:08.000000000 -0700
@@ -2903,7 +2903,7 @@ int ext4_write_inode(struct inode *inode
return 0;
if (ext4_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;
}
Index: linux-2.6.22/fs/jbd2/recovery.c
===================================================================
--- linux-2.6.22.orig/fs/jbd2/recovery.c 2007-07-18 19:25:51.000000000 -0700
+++ linux-2.6.22/fs/jbd2/recovery.c 2007-07-18 19:26:13.000000000 -0700
@@ -251,10 +251,10 @@ int jbd2_journal_recover(journal_t *jour
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
@@ -298,7 +298,7 @@ int jbd2_journal_skip_recovery(journal_t
#ifdef CONFIG_JBD2_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-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-07-19 3:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-18 21:37 new ext4 build warnings Jeff Garzik
2007-07-19 0:59 ` Mingming Cao
2007-07-19 3:07 ` [PATCH] fix ext4/JBD2 " Mingming Cao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).