WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

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

To: "xen-devel" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] BUG in blkback? on bio generation
From: "Y. D." <duyuyang@xxxxxxxxx>
Date: Thu, 25 Dec 2008 15:44:52 +0800
Cc: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Delivery-date: Wed, 24 Dec 2008 23:45:59 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:x-mailer:mime-version:content-type :content-transfer-encoding; bh=jmUi7EQquPF+27UvJvpPFMWxJAIVc7uR5RQrsLCxuro=; b=G740594diL3gVboEG4Bcgiw4bp4d9B+3XbuFnK9Y90veGXflXZ4yIuz9fy5stO5MyR ZRBK4hzZp2QzH4rEScTcKdf2uF6pJRGvKYuCfuqVmVLZWDkZ4o2CY0YAMGt/CfSlALHm FT3ngOOwM5azAiNU+2ZECRExeixXb7R2l07V0=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:x-mailer:mime-version :content-type:content-transfer-encoding; b=FPdMw/0w84sj4OM7nOyNSwniie6LH3cFnhi74xWuW8CdqeP0ZZsrscYp6tmGfyZkXi gfVK0/m+GT1p7d9hLFL+QHdnvIhK8mFgSgL/hT0tD8yb+uysez1dUEtEOlBV4+7qPbJH bKJumWqFpgleNLdm35dYJ4UW3oiob3XY+43kg=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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

<Prev in Thread] Current Thread [Next in Thread>