xfs
[Top] [All Lists]

Re: xfs: use named array initializers for log item dumping

To: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Subject: Re: xfs: use named array initializers for log item dumping
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Thu, 7 Apr 2016 06:20:23 +1000
Cc: darrick.wong@xxxxxxxxxx, xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <20160406105657.GA30644@mwanda>
References: <20160406105657.GA30644@mwanda>
User-agent: Mutt/1.5.21 (2010-09-15)
On Wed, Apr 06, 2016 at 01:56:57PM +0300, Dan Carpenter wrote:
> Hello Darrick J. Wong,
> 
> The patch 5110cd82ca90: "xfs: use named array initializers for log
> item dumping" from Mar 7, 2016, leads to the following static checker
> warning:
> 
>       fs/xfs/xfs_log.c:2085 xlog_print_tic_res()
>       error: buffer overflow 'trans_type_str' 43 <= 43
> 
> fs/xfs/xfs_log.c
>   2080  
>   2081          xfs_warn(mp, "xlog_write: reservation summary:");
>   2082          xfs_warn(mp, "  trans type  = %s (%u)",
>   2083                   ((ticket->t_trans_type <= 0 ||
>   2084                     ticket->t_trans_type > XFS_TRANS_TYPE_MAX) ?
>                                                 ^
> Should be >=.  Why is zero invalid?
> 
>   2085                    "bad-trans-type" : 
> trans_type_str[ticket->t_trans_type]),
>   2086                   ticket->t_trans_type);
>   2087          xfs_warn(mp, "  unit res    = %d bytes",

I just pushed patches to the for-next branch (i.e. linux-next) that
remove this code.

https://git.kernel.org/cgit/linux/kernel/git/dgc/linux-xfs.git/commit/?h=for-next&id=710b1e2c2948c1e5d0499def5273ecbc6472342d

Cheers,

Dave.

-- 
Dave Chinner
david@xxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>