Re: [PATCH 02/32 V2] xfs: remove xfs_tosspages

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

 



On 11/14/2012 12:42 AM, Dave Chinner wrote:
> xfs: remove xfs_tosspages
> 
> From: Dave Chinner <dchinner@xxxxxxxxxx>
> 
> 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@xxxxxxx>
> Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>
> ---

>  	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)

This exact like was in my original patch, though it returned if this was
true. -- Also, it needs to be "or equal to" for the case of passing
[4095,4096] -- after we round down and subtract one, they'll be equal
and the call will zero one byte.

--

I'll follow up with a patch just so Ben can get this pulled today.

Looks great though!

Reviewed-By: Andrew Dahl <adahl@xxxxxxx>

_______________________________________________
xfs mailing list
xfs@xxxxxxxxxxx
http://oss.sgi.com/mailman/listinfo/xfs


[Index of Archives]     [Linux XFS Devel]     [Linux Filesystem Development]     [Filesystem Testing]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux