[PATCH 3/5] xfs: prevent extsize alignment from exceeding maximum extent size

Dave Chinner david at fromorbit.com
Mon Jan 24 17:32:18 CST 2011


On Mon, Jan 24, 2011 at 04:04:59AM -0500, Christoph Hellwig wrote:
> > +					/*
> > +					 * make sure we don't exceed a single
> > +					 * extent length when we align the
> > +					 * extent by reducing length we are
> > +					 * going to allocate by the maximum
> > +					 * amount extent size aligment may
> > +					 * require.
> > +					alen = (xfs_extlen_t)XFS_FILBLKS_MIN(
> > +							len,
> > +						MAXEXTLEN - (2 * extsz - 1));
> > +					 */
> 
> This essentially just adds a comment, given that the new code is inside
> the bracing.  Also the xfs_extlen_t cast seems pointless.  The C type
> promotion rules do just fine for going down from a 64bit type to a 32bit
> one, as long as the results fit into the latter - which they always do
> here.

Argh, forgot to refresh the patch after doing some bug hunting.
I'll fix it and retest before I repost it.

Cheers,

Dave.
-- 
Dave Chinner
david at fromorbit.com




More information about the xfs mailing list