From: "Lily Huang" Subject: question about GET_ID_FROM_FREELIST function in blkfront Date: Thu, 11 May 2006 13:46:28 -0400 Message-ID: <4d616cca0605111046w45db7bedm2c86b123b395e756@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0177472238==" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Mime-version: 1.0 Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel List-Id: xen-devel@lists.xenproject.org --===============0177472238== Content-Type: multipart/alternative; boundary="----=_Part_9883_26098256.1147369588587" ------=_Part_9883_26098256.1147369588587 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi, I noticed that the last element of freelist is initialized to be 0x0fffffff with the code below ---info->shadow[BLK_RING_SIZE-1].req.id =3D 0x0fffffff; This means the last element points to an invalid slot. But question is: if the last element is allocated, info->shadow_free will b= e this invalid slot 0x0fffffff, which may trigger the bug checking code "BUG_ON(free > BLK_RING_SIZE);" How to avoid this? Is this a reasonable design? Thanks, -l ------=_Part_9883_26098256.1147369588587 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi,

I noticed that the last element of freelist is initialized to be= 0x0fffffff with the code below
---info->shadow[BLK_RING_SIZE-1].req.= id =3D 0x0fffffff;

This means the last element points to an invalid = slot.=20

But question is: if the last element is allocated, info->shadow_= free will be this invalid slot 0x0fffffff, which may trigger the
bug che= cking code  "BUG_ON(free > BLK_RING_SIZE);"

How t= o avoid this? Is this a reasonable design?

Thanks,
-l

------=_Part_9883_26098256.1147369588587-- --===============0177472238== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============0177472238==--