lkml.org 
[lkml]   [2009]   [Oct]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [patch] Staging: hv: Fix vmbus load hang caused by wrong data packing
Date


Greg / Pecca,

>We don't merge fixes to the kernel unless we understand _why_ they fix
>things. It's pretty likely that the problem here is that one or more
>of the structs you are putting under "#pragma pack" just need to be
>annotated with "attribute packed".

We have figured out what the problem is with it.

It seems that the #pragma pack(push,1) doesn't change the size
of "enum vmbus_channel_message_type", the size remains as 4 bytes,
which is the default. I do not know if this is the result of
a gcc bug.

If you add __attribute__((packed)) here, the size becomes 1 byte,
which couldn't be accepted by HyperV host, and causes vmbus load
to hang.

So, the different behavior of #pragma pack(push,1) v.s.
__attribute__((packed)) on the data struct, "enum vmbus_channel_message_type",
caused this bug. The fix is to remove __attribute__((packed)) of this data.
We don't need to add #pragma pack(push,1) or #pragma pack(pop) here, since
it has no effect on this structure. (BTW, seems it's a bug of gcc's
handling of pragma pack().)

I will submit a patch later today that corrects the bug.

This patch in effect removes part of a previous patch somebody else
Submitted that introduced this problem.

This bug masked another problem we encountered as soon as we fixed this
Problem. I am getting a NULL pointer problem on insertion of the hv_vmbus
Driver. I will write a more detailed description of that problem and send
It to the list.

I checked the originally submitted code, and made that work with 2.6.32.
And that does run okay.

Thanks,

Hank.



\
 
 \ /
  Last update: 2009-10-16 22:07    [W:0.067 / U:1.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site