xfs_logprint: di_gen is unsigned
diff mbox

Message ID c453839b-61db-9500-b39d-e6580d1748b5@redhat.com
State Accepted
Headers show

Commit Message

Eric Sandeen Dec. 5, 2016, 10:48 p.m. UTC
di_gen is unsigned:

        __uint32_t      di_gen;         /* generation number */

but we print it as a signed int in logprint, so see oddities like:

 forkoff:24  dmevmask:0x0  dmstate:0  flags:0x0  gen:-628807103

Fix this.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---


--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Brian Foster Dec. 7, 2016, 7:02 p.m. UTC | #1
On Mon, Dec 05, 2016 at 04:48:01PM -0600, Eric Sandeen wrote:
> di_gen is unsigned:
> 
>         __uint32_t      di_gen;         /* generation number */
> 
> but we print it as a signed int in logprint, so see oddities like:
> 
>  forkoff:24  dmevmask:0x0  dmstate:0  flags:0x0  gen:-628807103
> 
> Fix this.
> 
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---

Reviewed-by: Brian Foster <bfoster@redhat.com>

> 
> diff --git a/logprint/log_print_all.c b/logprint/log_print_all.c
> index f49316e..3863ba9 100644
> --- a/logprint/log_print_all.c
> +++ b/logprint/log_print_all.c
> @@ -269,7 +269,7 @@ xlog_recover_print_inode_core(
>  	       di->di_size, (unsigned long long)di->di_nblocks,
>  	       di->di_extsize, di->di_nextents, (int)di->di_anextents);
>  	printf(_("		forkoff:%d  dmevmask:0x%x  dmstate:%d  flags:0x%x  "
> -	     "gen:%d\n"),
> +	     "gen:%u\n"),
>  	       (int)di->di_forkoff, di->di_dmevmask, (int)di->di_dmstate,
>  	       (int)di->di_flags, di->di_gen);
>  	if (di->di_version == 3) {
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch
diff mbox

diff --git a/logprint/log_print_all.c b/logprint/log_print_all.c
index f49316e..3863ba9 100644
--- a/logprint/log_print_all.c
+++ b/logprint/log_print_all.c
@@ -269,7 +269,7 @@  xlog_recover_print_inode_core(
 	       di->di_size, (unsigned long long)di->di_nblocks,
 	       di->di_extsize, di->di_nextents, (int)di->di_anextents);
 	printf(_("		forkoff:%d  dmevmask:0x%x  dmstate:%d  flags:0x%x  "
-	     "gen:%d\n"),
+	     "gen:%u\n"),
 	       (int)di->di_forkoff, di->di_dmevmask, (int)di->di_dmstate,
 	       (int)di->di_flags, di->di_gen);
 	if (di->di_version == 3) {