Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 251259
b: refs/heads/master
c: 03e0edf
h: refs/heads/master
i:
  251257: 893c0d7
  251255: 567fc27
v: v3
  • Loading branch information
Konrad Rzeszutek Wilk committed May 12, 2011
1 parent f1696a1 commit 518d2e3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 41ca4d388560d2048c7b64ff5ca7dc3bac0d0812
refs/heads/master: 03e0edf946a08f498788bb6e8ab58453d98f25b9
9 changes: 6 additions & 3 deletions trunk/drivers/block/xen-blkback/blkback.c
Original file line number Diff line number Diff line change
Expand Up @@ -620,10 +620,11 @@ static int dispatch_rw_block_io(struct blkif_st *blkif,
seg[i].nsec << 9,
seg[i].buf & ~PAGE_MASK) == 0)) {

bio = biolist[nbio++] = bio_alloc(GFP_KERNEL, nseg-i);
bio = bio_alloc(GFP_KERNEL, nseg-i);
if (unlikely(bio == NULL))
goto fail_put_bio;

biolist[nbio++] = bio;
bio->bi_bdev = preq.bdev;
bio->bi_private = pending_req;
bio->bi_end_io = end_block_io_op;
Expand All @@ -636,10 +637,12 @@ static int dispatch_rw_block_io(struct blkif_st *blkif,
/* This will be hit if the operation was a flush. */
if (!bio) {
BUG_ON(operation != WRITE_FLUSH);
bio = biolist[nbio++] = bio_alloc(GFP_KERNEL, 0);

bio = bio_alloc(GFP_KERNEL, 0);
if (unlikely(bio == NULL))
goto fail_put_bio;

biolist[nbio++] = bio;
bio->bi_bdev = preq.bdev;
bio->bi_private = pending_req;
bio->bi_end_io = end_block_io_op;
Expand Down Expand Up @@ -677,7 +680,7 @@ static int dispatch_rw_block_io(struct blkif_st *blkif,
return -EIO;

fail_put_bio:
for (i = 0; i < (nbio-1); i++)
for (i = 0; i < nbio; i++)
bio_put(biolist[i]);
__end_block_io_op(pending_req, -EINVAL);
msleep(1); /* back off a bit */
Expand Down
6 changes: 4 additions & 2 deletions trunk/drivers/block/xen-blkback/xenbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -538,15 +538,17 @@ static void backend_changed(struct xenbus_watch *watch,
err = vbd_create(be->blkif, handle, major, minor,
(NULL == strchr(be->mode, 'w')), cdrom);
if (err) {
be->major = be->minor = 0;
be->major = 0;
be->minor = 0;
xenbus_dev_fatal(dev, err, "creating vbd structure");
return;
}

err = xenvbd_sysfs_addif(dev);
if (err) {
vbd_free(&be->blkif->vbd);
be->major = be->minor = 0;
be->major = 0;
be->minor = 0;
xenbus_dev_fatal(dev, err, "creating sysfs entries");
return;
}
Expand Down

0 comments on commit 518d2e3

Please sign in to comment.