提交 4ff57935 编写于 作者: J Jens Axboe 提交者: Linus Torvalds

[PATCH] ide: preserve errors for failed requests

To preserve the ->errors values for requests that failed, use the normal
completion path for that.
Signed-off-by: NJens Axboe <axboe@suse.de>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 c8d52465
...@@ -60,10 +60,10 @@ void ide_softirq_done(struct request *rq) ...@@ -60,10 +60,10 @@ void ide_softirq_done(struct request *rq)
request_queue_t *q = rq->q; request_queue_t *q = rq->q;
add_disk_randomness(rq->rq_disk); add_disk_randomness(rq->rq_disk);
end_that_request_chunk(rq, rq->errors, rq->data_len); end_that_request_chunk(rq, 1, rq->data_len);
spin_lock_irq(q->queue_lock); spin_lock_irq(q->queue_lock);
end_that_request_last(rq, rq->errors); end_that_request_last(rq, 1);
spin_unlock_irq(q->queue_lock); spin_unlock_irq(q->queue_lock);
} }
...@@ -96,11 +96,12 @@ int __ide_end_request(ide_drive_t *drive, struct request *rq, int uptodate, ...@@ -96,11 +96,12 @@ int __ide_end_request(ide_drive_t *drive, struct request *rq, int uptodate,
/* /*
* For partial completions (or non fs/pc requests), use the regular * For partial completions (or non fs/pc requests), use the regular
* direct completion path. * direct completion path. Same thing for requests that failed, to
* preserve the ->errors value we use the normal completion path
* for those
*/ */
nbytes = nr_sectors << 9; nbytes = nr_sectors << 9;
if (rq_all_done(rq, nbytes)) { if (!rq->errors && rq_all_done(rq, nbytes)) {
rq->errors = uptodate;
rq->data_len = nbytes; rq->data_len = nbytes;
blkdev_dequeue_request(rq); blkdev_dequeue_request(rq);
HWGROUP(drive)->rq = NULL; HWGROUP(drive)->rq = NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册