Re: [PATCH v3] kasan/quarantine: fix bugs on qlist_move_cache()

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

 



On Fri, Jul 1, 2016 at 4:18 PM, Andrey Ryabinin <aryabinin@xxxxxxxxxxxxx> wrote:
>
>
> On 07/01/2016 05:15 PM, Dmitry Vyukov wrote:
>> On Fri, Jul 1, 2016 at 4:09 PM, Joonsoo Kim <js1304@xxxxxxxxx> wrote:
>>> 2016-07-01 23:03 GMT+09:00 Dmitry Vyukov <dvyukov@xxxxxxxxxx>:
>
>>>>> +
>>>>> +               if (obj_cache == cache)
>>>>> +                       qlist_put(to, qlink, cache->size);
>>>>> +               else
>>>>> +                       qlist_put(from, qlink, cache->size);
>>>>
>>>> This line is wrong. If obj_cache != cache, object size != cache->size.
>>>> Quarantine contains objects of different sizes.
>>>
>>> You're right. 11 pm is not good time to work. :/
>>> If it is fixed, the patch looks correct to you?
>>> I will fix it and send v4 on next week.
>>
>>
>> I don't see anything else wrong. But I need to see how you fix the size issue.
>> Performance of this operation is not particularly critical, so the
>> simpler the better.
>
> Is there any other way besides obvious: s/cache->size/obj_cache->size ?

We can remember the original bytes, then subtract
num_objects_moved*cache->size from it and assign to from->bytes.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]