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

[Xen-devel] BUG in blkback? on bio generation


  • To: "xen-devel" <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • From: "Y. D." <duyuyang@xxxxxxxxx>
  • Date: Thu, 25 Dec 2008 15:48:44 +0800
  • Delivery-date: Wed, 24 Dec 2008 23:49:28 -0800
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:subject:message-id:x-mailer:mime-version:content-type :content-transfer-encoding; b=KrB2sVqb/kvbEwqAwnnNWkBK8UYBRPxAWjutZt3FnQGUuT1RqjXLmmI6vaGaGhBdXC y9iW895oLQevdnoUILrvw5cH9Lktah81oArdc+7LdzaJb2gOTpefH7yLvl7ayYDWpYgX UOEDIcxMOtl0B3nDzpKiUMDb+WfWZtzAR+lzc=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

Hi,

Merry Christmas.

I am reading code in blkback.c, while I find that the bio generation might be 
really bad. 
The bio_add_page() returns length of added bio vector, so if it fails it 
returns 0.
Therefore, should not bio_add_page() be negated in the while() loop condition??

        for (i = 0; i < nseg; i++) {           
                if (((int)preq.sector_number|(int)seg[i].nsec) &
                    ((bdev_hardsect_size(preq.bdev) >> 9) - 1)) {
                        DPRINTK("Misaligned I/O request from domain %d",
                                blkif->domid);         
                        goto fail_put_bio;     
                }             

                while ((bio == NULL) ||           
          -------->(bio_add_page(bio,                           
                                     virt_to_page(vaddr(pending_req, i)),
                                     seg[i].nsec << 9,              
                                     seg[i].buf & ~PAGE_MASK) == 0)) {
                        bio = biolist[nbio++] = bio_alloc(GFP_KERNEL, nseg-i);
                        if (unlikely(bio == NULL))             
                                goto fail_put_bio;                              
                                                                               

                        bio->bi_bdev    = preq.bdev;   
                        bio->bi_private = pending_req; 
                        bio->bi_end_io  = end_block_io_op;
                        bio->bi_sector  = preq.sector_number;                   
                                                                               
                }             

                preq.sector_number += seg[i].nsec;
        }

Cheers,
Shawn


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

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