[PATCH 02/32 V2] xfs: remove xfs_tosspages

Dave Chinner david at fromorbit.com
Wed Nov 14 15:17:45 CST 2012


On Wed, Nov 14, 2012 at 12:50:47PM -0600, Andrew Dahl wrote:
> On 11/14/2012 12:42 AM, Dave Chinner wrote:
> > xfs: remove xfs_tosspages
> > 
> > From: Dave Chinner <dchinner at redhat.com>
> > 
> > It's a buggy, unnecessary wrapper that is duplicating
> > truncate_pagecache_range().
> > 
> > When replacing the call in xfs_change_file_space(), also ensure that
> > the length being allocated/freed is always positive before making
> > any changes. These checks are done in the lower extent manipulation
> > functions, too, but we need to do them before any page cache
> > operations.
> > 
> > Reported-by: Andrew Dahl <adahl at sgi.com>
> > Signed-off-by: Dave Chinner <dchinner at redhat.com>
> > ---
> 
> >  	case XFS_IOC_ZERO_RANGE:
> >  		prealloc_type |= XFS_BMAPI_CONVERT;
> > -		xfs_tosspages(ip, startoffset, startoffset + bf->l_len, 0);
> > +		end = round_down(startoffset + bf->l_len, PAGE_SIZE) - 1;
> > +		if (startoffset > end)
> 
> This should be
> 
> if (startoffset <= end)

Duh - that's quite a thinko. :/

And I missed the fact that 242 failed in my rush to get it out. I
should have caught that before I sent it. My mistake.

Thanks for getting it fixed, though.

Cheers,

Dave.
-- 
Dave Chinner
david at fromorbit.com



More information about the xfs mailing list