[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH] xen/grant-table: correctly initialize grant table version 1
On Thu, Dec 20, 2012 at 11:42:05AM +0800, ANNIE LI wrote: > > Thanks for posting this. > This is caused by not initializing grant_table_version in > gnttab_init() before gnttab_resume(). How about only adding > gnttab_request_version() and BUG_ON() to check grant_table_version > in gnttab_init(), then no need to change GREFS_PER_GRANT_FRAME into > grefs_per_grant_frame and add more BUG_ON() to check > grefs_per_grant_frame? > > For example, in gnttab_init() > .... > > +gnttab_request_version(); > +BUG_ON(grant_table_version == 0); > Having GREFS_PER_GRANT_FRAME evaluate a conditional every time it's used makes me uneasy. I know I added excessive BUG_ON()s, but my intent was just to be defensive. GREFS_PER_GRANT_FRAME is used in the conditional part of for (...) loops in several locations. I think it's better to have this as a variable instead of a conditional expression. Matt _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |