diff options
-rw-r--r-- | kernel/core.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/kernel/core.c b/kernel/core.c index 5ec7515..9180e40 100644 --- a/kernel/core.c +++ b/kernel/core.c @@ -315,12 +315,15 @@ void dnbd2_end_request(struct request *req, int success) spin_lock_irqsave(&dev->blk_lock, flags); list_del_init(&req->queuelist); #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25) - if(!__blk_end_request(req, success, blk_rq_sectors(req))) { + // success: 0 for success, < 0 for error + success = (success == 1) ? 0 : -1; + __blk_end_request_cur(req, success); #else + // success: 1 for success, 0 for I/O error, < 0 for specific error if (!end_that_request_first(req, success, blk_rq_sectors(req))) { end_that_request_last(req, success); -#endif } +#endif dev->pending_reqs--; spin_unlock_irqrestore(&dev->blk_lock, flags); info->cnt = -1; |