xfs
[Top] [All Lists]

Re: [PATCH] fix overflow in xfs_growfs_data_private

To: Eric Sandeen <sandeen@xxxxxxxxxxx>
Subject: Re: [PATCH] fix overflow in xfs_growfs_data_private
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Mon, 25 May 2009 06:15:29 -0400
Cc: xfs-oss <xfs@xxxxxxxxxxx>, Richard Ems <Richard.Ems@xxxxxxxxxxxxxxxxx>
In-reply-to: <4A184EC4.1050007@xxxxxxxxxxx>
References: <4A184EC4.1050007@xxxxxxxxxxx>
User-agent: Mutt/1.5.18 (2008-05-17)
On Sat, May 23, 2009 at 02:30:12PM -0500, Eric Sandeen wrote:
> Index: linux-2.6/fs/xfs/xfs_fsops.c
> ===================================================================
> --- linux-2.6.orig/fs/xfs/xfs_fsops.c
> +++ linux-2.6/fs/xfs/xfs_fsops.c
> @@ -160,7 +160,7 @@ xfs_growfs_data_private(
>       nagcount = new + (nb_mod != 0);
>       if (nb_mod && nb_mod < XFS_MIN_AG_BLOCKS) {
>               nagcount--;
> -             nb = nagcount * mp->m_sb.sb_agblocks;
> +             nb = (xfs_rfsblock_t)nagcount * mp->m_sb.sb_agblocks;
>               if (nb < mp->m_sb.sb_dblocks)
>                       return XFS_ERROR(EINVAL);

Nice one! Thanks dear C integer promotion rules..

Would be good to get this into 2.6.30


Reviewed-by: Christoph Hellwig <hch@xxxxxx>

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