14 messages in com.xensource.lists.xen-develRe: [Xen-devel] Re: [PATCH 2.6.12.6-x...
FromSent OnAttachments
Mike D. Day27 Jan 2006 18:19 
Greg KH27 Jan 2006 18:25 
Greg KH27 Jan 2006 18:38 
Anthony Liguori27 Jan 2006 19:02 
Vincent Hanquez28 Jan 2006 04:23 
Dave Hansen30 Jan 2006 08:18 
Mike D. Day30 Jan 2006 08:57 
Dave Hansen30 Jan 2006 09:04 
Mike D. Day30 Jan 2006 09:16 
Greg KH30 Jan 2006 09:25 
Dave Hansen30 Jan 2006 09:38 
Keir Fraser30 Jan 2006 09:53 
Dave Hansen30 Jan 2006 09:56 
Greg KH30 Jan 2006 11:32 
Subject:Re: [Xen-devel] Re: [PATCH 2.6.12.6-xen] sysfs attributes for xen
From:Dave Hansen (have@us.ibm.com)
Date:01/30/2006 09:04:02 AM
List:com.xensource.lists.xen-devel

On Mon, 2006-01-30 at 11:58 -0500, Mike D. Day wrote:

Dave Hansen wrote:

Where does that 1024 come from? Is it a guarantee from Xen that it will never fill more than 1k? I know it is a long shot, but what if the page size is less than 1k? Would this function have strange results?

Per the xen headers, this particular hcall option returns a typedef char[1024] thingy_t (which is simply a char [1024] in the patch). Yes, if the page size is < 1024 there is a problem. So a check against PAGE_SIZE may be prudent.

I was just looking, and noticed that there is a check in the sysfs ->show() code that checks for return values greater than PAGE_SIZE and BUG()s, so you at least won't get silent corruption. That is probably good enough to not worry about it.

In the final version, there will be available Xen headers, and the patch won't need the open-coded 1024?

-- Dave