Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 77625
b: refs/heads/master
c: 5e36bb6
h: refs/heads/master
i:
  77623: fb19a14
v: v3
  • Loading branch information
Kiyoshi Ueda authored and Jens Axboe committed Jan 28, 2008
1 parent 91824cd commit 0f4dae8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ea6f06f416347448645e60294d92c0c19aba8589
refs/heads/master: 5e36bb6ee8d5ff6c6114b60d2aaa1c70d4275f4e
6 changes: 3 additions & 3 deletions trunk/drivers/ide/ide-cd.c
Original file line number Diff line number Diff line change
Expand Up @@ -655,9 +655,9 @@ static void cdrom_end_request (ide_drive_t *drive, int uptodate)
BUG();
} else {
spin_lock_irqsave(&ide_lock, flags);
end_that_request_chunk(failed, 0,
failed->data_len);
end_that_request_last(failed, 0);
if (__blk_end_request(failed, -EIO,
failed->data_len))
BUG();
spin_unlock_irqrestore(&ide_lock, flags);
}
} else
Expand Down
25 changes: 12 additions & 13 deletions trunk/drivers/ide/ide-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,19 @@ static int __ide_end_request(ide_drive_t *drive, struct request *rq,
int uptodate, unsigned int nr_bytes, int dequeue)
{
int ret = 1;
int error = 0;

if (uptodate <= 0)
error = uptodate ? uptodate : -EIO;

/*
* if failfast is set on a request, override number of sectors and
* complete the whole request right now
*/
if (blk_noretry_request(rq) && end_io_error(uptodate))
if (blk_noretry_request(rq) && error)
nr_bytes = rq->hard_nr_sectors << 9;

if (!blk_fs_request(rq) && end_io_error(uptodate) && !rq->errors)
if (!blk_fs_request(rq) && error && !rq->errors)
rq->errors = -EIO;

/*
Expand All @@ -78,14 +82,9 @@ static int __ide_end_request(ide_drive_t *drive, struct request *rq,
ide_dma_on(drive);
}

if (!end_that_request_chunk(rq, uptodate, nr_bytes)) {
add_disk_randomness(rq->rq_disk);
if (dequeue) {
if (!list_empty(&rq->queuelist))
blkdev_dequeue_request(rq);
if (!__blk_end_request(rq, error, nr_bytes)) {
if (dequeue)
HWGROUP(drive)->rq = NULL;
}
end_that_request_last(rq, uptodate);
ret = 0;
}

Expand Down Expand Up @@ -290,9 +289,9 @@ static void ide_complete_pm_request (ide_drive_t *drive, struct request *rq)
drive->blocked = 0;
blk_start_queue(drive->queue);
}
blkdev_dequeue_request(rq);
HWGROUP(drive)->rq = NULL;
end_that_request_last(rq, 1);
if (__blk_end_request(rq, 0, 0))
BUG();
spin_unlock_irqrestore(&ide_lock, flags);
}

Expand Down Expand Up @@ -387,10 +386,10 @@ void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 err)
}

spin_lock_irqsave(&ide_lock, flags);
blkdev_dequeue_request(rq);
HWGROUP(drive)->rq = NULL;
rq->errors = err;
end_that_request_last(rq, !rq->errors);
if (__blk_end_request(rq, (rq->errors ? -EIO : 0), 0))
BUG();
spin_unlock_irqrestore(&ide_lock, flags);
}

Expand Down

0 comments on commit 0f4dae8

Please sign in to comment.