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

[Xen-devel] Why cast to "signed short" before checking the return value of gnttab_claim_grant_reference() in xen-netfront.c?


  • To: Xen-Devel <xen-devel@xxxxxxxxxxxxx>
  • From: Dongli Zhang <dongli.zhang@xxxxxxxxxx>
  • Date: Thu, 27 Oct 2016 23:46:05 -0700 (PDT)
  • Delivery-date: Fri, 28 Oct 2016 06:46:45 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>

Hi,

Would anyone please help with a question on xen-netfront.c code?

In xen-netfront.c, the return value of gnttab_claim_grant_reference() is
checked with "BUG_ON((signed short)ref < 0);". Why we use signed short here
while the return value is of uint32_t? 

Am I missing anything or can I send a patch to fix this issue? In
xen-blkfront.c and xen-scsifront.c "BUG_ON(gnt_list_entry->gref == -ENOSPC);"
is involved to check return value. 

The guest kernel would panic after grant refs reach a very large number (when
guest is attached with large number of devices and live migrated).

Thank you very much!

Dongli Zhang

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

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