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

Re: [Xen-devel] Re: [PATCH] sysfs attributes for xen

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

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.