| To: | Dave Chinner <david@xxxxxxxxxxxxx> |
|---|---|
| Subject: | Re: [PATCH 02.5/32] xfs: remove xfs_tosspages |
| From: | Andrew Dahl <adahl@xxxxxxx> |
| Date: | Mon, 26 Nov 2012 12:04:05 -0600 |
| Cc: | Mark Tinguely <tinguely@xxxxxxx>, <xfs@xxxxxxxxxxx> |
| In-reply-to: | <20121122232920.GX2591@dastard> |
| References: | <1352721264-3700-1-git-send-email-david@xxxxxxxxxxxxx> <1352721264-3700-3-git-send-email-david@xxxxxxxxxxxxx> <20121114064247.GC1710@dastard> <50A3E807.5010403@xxxxxxx> <50A3E86A.2060402@xxxxxxx> <50A3F80C.7050502@xxxxxxx> <20121121080502.GP2591@dastard> <50ADB3AA.302@xxxxxxx> <20121122232920.GX2591@dastard> |
| User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121029 Thunderbird/16.0.2 |
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
|
| Previous by Date: | Re: [PATCH] xfs: Remove the description about nodelaylog mount option from, the xfs document., Ben Myers |
|---|---|
| Next by Date: | Re: [PATCH 1/3] xfs: inode allocation should use unmapped buffers., Mark Tinguely |
| Previous by Thread: | Re: [PATCH 02.5/32] xfs: remove xfs_tosspages, Dave Chinner |
| Next by Thread: | Re: [PATCH 02/32 V2] xfs: remove xfs_tosspages, Dave Chinner |
| Indexes: | [Date] [Thread] [Top] [All Lists] |