Skip to content

Commit fcdf3c3

Browse files
arndbtytso
authored andcommitted
ext4: fix debug format string warning
Using no_printk() for jbd_debug() revealed two warnings: fs/jbd2/recovery.c: In function 'fc_do_one_pass': fs/jbd2/recovery.c:256:30: error: format '%d' expects a matching 'int' argument [-Werror=format=] 256 | jbd_debug(3, "Processing fast commit blk with seq %d"); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fs/ext4/fast_commit.c: In function 'ext4_fc_replay_add_range': fs/ext4/fast_commit.c:1732:30: error: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Werror=format=] 1732 | jbd_debug(1, "Converting from %d to %d %lld", The first one was added incorrectly, and was also missing a few newlines in debug output, and the second one happened when the type of an argument changed. Reported-by: kernel test robot <[email protected]> Fixes: d556435 ("jbd2: avoid -Wempty-body warnings") Fixes: 6db0746 ("ext4: use BIT() macro for BH_** state bits") Fixes: 5b849b5 ("jbd2: fast commit recovery path") Signed-off-by: Arnd Bergmann <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Theodore Ts'o <[email protected]>
1 parent 666245d commit fcdf3c3

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

fs/ext4/fast_commit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1736,7 +1736,7 @@ static int ext4_fc_replay_add_range(struct super_block *sb,
17361736
}
17371737

17381738
/* Range is mapped and needs a state change */
1739-
jbd_debug(1, "Converting from %d to %d %lld",
1739+
jbd_debug(1, "Converting from %ld to %d %lld",
17401740
map.m_flags & EXT4_MAP_UNWRITTEN,
17411741
ext4_ext_is_unwritten(ex), map.m_pblk);
17421742
ret = ext4_ext_replay_update_ex(inode, cur, map.m_len,

fs/jbd2/recovery.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,15 +245,14 @@ static int fc_do_one_pass(journal_t *journal,
245245
return 0;
246246

247247
while (next_fc_block <= journal->j_fc_last) {
248-
jbd_debug(3, "Fast commit replay: next block %ld",
248+
jbd_debug(3, "Fast commit replay: next block %ld\n",
249249
next_fc_block);
250250
err = jread(&bh, journal, next_fc_block);
251251
if (err) {
252-
jbd_debug(3, "Fast commit replay: read error");
252+
jbd_debug(3, "Fast commit replay: read error\n");
253253
break;
254254
}
255255

256-
jbd_debug(3, "Processing fast commit blk with seq %d");
257256
err = journal->j_fc_replay_callback(journal, bh, pass,
258257
next_fc_block - journal->j_fc_first,
259258
expected_commit_id);

0 commit comments

Comments
 (0)