diff options
author | Johann Latocha | 2011-06-29 06:02:50 +0200 |
---|---|---|
committer | Johann Latocha | 2011-06-29 06:02:50 +0200 |
commit | 11b14af083f8ff5a5889be5a2b31836210cb87c4 (patch) | |
tree | 15e248d3e8da90c689ce5da6102333bc2beb5c56 /kernel | |
parent | working with current kernel, ifdef switch for other kernel versions needs to ... (diff) | |
download | dnbd2-11b14af083f8ff5a5889be5a2b31836210cb87c4.tar.gz dnbd2-11b14af083f8ff5a5889be5a2b31836210cb87c4.tar.xz dnbd2-11b14af083f8ff5a5889be5a2b31836210cb87c4.zip |
Defect #350
Diffstat (limited to 'kernel')
-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; |