aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/block/xen-blkfront.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index 2bdebcb3ff16..8afce67c0aa5 100644
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -452,7 +452,7 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id)
452 RING_IDX i, rp; 452 RING_IDX i, rp;
453 unsigned long flags; 453 unsigned long flags;
454 struct blkfront_info *info = (struct blkfront_info *)dev_id; 454 struct blkfront_info *info = (struct blkfront_info *)dev_id;
455 int uptodate; 455 int error;
456 456
457 spin_lock_irqsave(&blkif_io_lock, flags); 457 spin_lock_irqsave(&blkif_io_lock, flags);
458 458
@@ -477,13 +477,13 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id)
477 477
478 add_id_to_freelist(info, id); 478 add_id_to_freelist(info, id);
479 479
480 uptodate = (bret->status == BLKIF_RSP_OKAY); 480 error = (bret->status == BLKIF_RSP_OKAY) ? 0 : -EIO;
481 switch (bret->operation) { 481 switch (bret->operation) {
482 case BLKIF_OP_WRITE_BARRIER: 482 case BLKIF_OP_WRITE_BARRIER:
483 if (unlikely(bret->status == BLKIF_RSP_EOPNOTSUPP)) { 483 if (unlikely(bret->status == BLKIF_RSP_EOPNOTSUPP)) {
484 printk(KERN_WARNING "blkfront: %s: write barrier op failed\n", 484 printk(KERN_WARNING "blkfront: %s: write barrier op failed\n",
485 info->gd->disk_name); 485 info->gd->disk_name);
486 uptodate = -EOPNOTSUPP; 486 error = -EOPNOTSUPP;
487 info->feature_barrier = 0; 487 info->feature_barrier = 0;
488 xlvbd_barrier(info); 488 xlvbd_barrier(info);
489 } 489 }
@@ -494,10 +494,8 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id)
494 dev_dbg(&info->xbdev->dev, "Bad return from blkdev data " 494 dev_dbg(&info->xbdev->dev, "Bad return from blkdev data "
495 "request: %x\n", bret->status); 495 "request: %x\n", bret->status);
496 496
497 ret = end_that_request_first(req, uptodate, 497 ret = __blk_end_request(req, error, blk_rq_bytes(req));
498 req->hard_nr_sectors);
499 BUG_ON(ret); 498 BUG_ON(ret);
500 end_that_request_last(req, uptodate);
501 break; 499 break;
502 default: 500 default:
503 BUG(); 501 BUG();