aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/block/nbd.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index ba9b17e507e0..ae3106045ee5 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -100,17 +100,15 @@ static const char *nbdcmd_to_ascii(int cmd)
100 100
101static void nbd_end_request(struct request *req) 101static void nbd_end_request(struct request *req)
102{ 102{
103 int uptodate = (req->errors == 0) ? 1 : 0; 103 int error = req->errors ? -EIO : 0;
104 struct request_queue *q = req->q; 104 struct request_queue *q = req->q;
105 unsigned long flags; 105 unsigned long flags;
106 106
107 dprintk(DBG_BLKDEV, "%s: request %p: %s\n", req->rq_disk->disk_name, 107 dprintk(DBG_BLKDEV, "%s: request %p: %s\n", req->rq_disk->disk_name,
108 req, uptodate? "done": "failed"); 108 req, error ? "failed" : "done");
109 109
110 spin_lock_irqsave(q->queue_lock, flags); 110 spin_lock_irqsave(q->queue_lock, flags);
111 if (!end_that_request_first(req, uptodate, req->nr_sectors)) { 111 __blk_end_request(req, error, req->nr_sectors << 9);
112 end_that_request_last(req, uptodate);
113 }
114 spin_unlock_irqrestore(q->queue_lock, flags); 112 spin_unlock_irqrestore(q->queue_lock, flags);
115} 113}
116 114