Re: [PATCH 2/3] xfs_scrub: initialize movon in

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Mar 27, 2018 at 05:11:49PM -0500, Eric Sandeen wrote:
> Given the logic in xfs_scrub_connections, it's possible to
> fail all 3 tests and wind up checking an uninitialized moveon
> variable at the end.  Start out with "true" to avoid this and
> move on even if all the conditions in the function are false.
> 
> Fixes-coverity-id: 1433617
> Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>

Subject line needs typo fix, but otherwise:

Reviewed-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx>

--D

> ---
> 
> diff --git a/scrub/phase5.c b/scrub/phase5.c
> index 8e0a1be..5f2a1a7 100644
> --- a/scrub/phase5.c
> +++ b/scrub/phase5.c
> @@ -244,7 +244,7 @@ xfs_scrub_connections(
>  {
>  	bool			*pmoveon = arg;
>  	char			descr[DESCR_BUFSZ];
> -	bool			moveon;
> +	bool			moveon = true;
>  	xfs_agnumber_t		agno;
>  	xfs_agino_t		agino;
>  	int			fd = -1;
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> 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@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux