[PATCH 02.5/32] xfs: remove xfs_tosspages

Andrew Dahl adahl at sgi.com
Mon Nov 26 12:04:05 CST 2012



On 11/22/2012 05:29 PM, Dave Chinner wrote:
> On Wed, Nov 21, 2012 at 11:10:02PM -0600, Andrew Dahl wrote:
>> On 11/21/2012 02:05 AM, Dave Chinner wrote:
>> ...
>>>
...

>>> +	} else {
>>> +		/* it's a sub-rounding range */
>>> +		ASSERT(offset + len <= rounding);
>> This is false. (8K - 2) <= 4K -- Not so good.
> 
> Right, I put this in after testing without thinking too hard about
> it. It's always completely wrong, because offset can be an arbitrary
> 64 bit number, and rounding will always be <=64k...
> 
>> Maybe (2*rounding) would be better, as offset + len could never be
>> greater than 2rounding (but can be greater than 1rounding). Or removing
>> this assert altogether.
> 
> No, the correct thing to assert is:
> 
> 		ASSERT(offset + len <= start);
> 
> That is, start is rounded up, and end is rounded down, so for a
> sub-block range the end should always be less than the start of the
> next block. That's what my current code has in it.

Ah... that makes sense.  Yeah, with that change, I'd say it looks great!

Thanks, Dave.

-Andrew



More information about the xfs mailing list