On Dec 20, 2012 5:36 AM, "Dmitry Antipov" <dmitry.antipov@linaro.org> wrote:
>
> On 12/20/2012 03:54 AM, John Stultz wrote:
>
>> So I'd suggest instead to make your test consistent with the kernel, rather then the other way around.
>
>
> This makes no sense if the kernel itself is buggy :-).
>
> Again, the root of evil is a bug in http://linux-arm.org/git?p=linux-2.6-armdroid.git;a=shortlog;h=refs/heads/linux-3.7-armdroid
> (k.org mainline has no such bug). I've tried to fix it, but this causes ABI break. So, if we can't change ASHMEM_GET_PIN_STATUS
> encoding, then this code is obviously wrong:
> ...
> case _IOC_NR(ASHMEM_PIN):
> case _IOC_NR(ASHMEM_UNPIN):
> case _IOC_NR(ASHMEM_GET_PIN_STATUS):
> if (_IOC_SIZE(cmd) != sizeof(struct ashmem_pin))
> pr_err("ashmem: ASHMEM_PIN transaction size differs\n");
> ...
> (because it assumes that sizeof(struct ashmem_pin) is encoded into ASHMEM_GET_PIN_STATUS).
>
> Serban, the code above was introduced at:
>
> http://linux-arm.org/git?p=linux-2.6-armdroid.git;a=commit;h=43632e1f14991580d608f72ddd861a280a016431
>
Yea, that kernel change will need to be dropped. I know Serban is reworking that patch and didn't see a similar issue in the latest version.
Regardless, kudos to your test case calling this issue out! Its doing exactly what we need.
Thanks
-john