lkml.org 
[lkml]   [2021]   [Apr]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] ext4: fix debug format string warning
On Fri, Apr 09, 2021 at 10:12:05PM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> 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 <lkp@intel.com>
> Fixes: d556435156b7 ("jbd2: avoid -Wempty-body warnings")
> Fixes: 6db074618969 ("ext4: use BIT() macro for BH_** state bits")
> Fixes: 5b849b5f96b4 ("jbd2: fast commit recovery path")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Thanks, applied, with one change.

> diff --git a/fs/jbd2/recovery.c b/fs/jbd2/recovery.c
> index 69f18fe20923..60601c5779f1 100644
> --- a/fs/jbd2/recovery.c
> +++ b/fs/jbd2/recovery.c
> @@ -245,15 +245,15 @@ static int fc_do_one_pass(journal_t *journal,
> ....
>
> if (err) {
> - jbd_debug(3, "Fast commit replay: read error");
> + jbd_debug(3, "Fast commit replay: read error\n");
> break;
> }
>
> - jbd_debug(3, "Processing fast commit blk with seq %d");
> + jbd_debug(3, "Processing fast commit blk with seq\n");

This debug statement isn't adding any real value, so I just removed
it.

- Ted

\
 
 \ /
  Last update: 2021-04-10 05:33    [W:0.072 / U:0.596 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site