aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/ide/ide-atapi.c7
-rw-r--r--drivers/ide/ide-cd.c3
-rw-r--r--drivers/ide/ide-disk.c2
-rw-r--r--drivers/ide/ide-eh.c5
-rw-r--r--drivers/ide/ide-floppy.c2
-rw-r--r--drivers/ide/ide-io.c5
-rw-r--r--drivers/ide/ide-tape.c2
7 files changed, 21 insertions, 5 deletions
diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c
index 5d57af2..5504a84 100644
--- a/drivers/ide/ide-atapi.c
+++ b/drivers/ide/ide-atapi.c
@@ -405,8 +405,13 @@ static ide_startstop_t ide_pc_intr(ide_drive_t *drive)
if (blk_special_request(rq)) {
rq->errors = 0;
ide_complete_rq(drive, 0);
- } else
+ } else {
+ if (blk_fs_request(rq) == 0 && uptodate <= 0) {
+ if (rq->errors == 0)
+ rq->errors = -EIO;
+ }
ide_end_request(drive, uptodate, 0);
+ }
return ide_stopped;
}
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index bbbebcb..e4fa807 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -295,6 +295,9 @@ static void cdrom_end_request(ide_drive_t *drive, int uptodate)
ide_debug_log(IDE_DBG_FUNC, "uptodate: 0x%x, nsectors: %d",
uptodate, nsectors);
+ if (blk_fs_request(rq) == 0 && uptodate <= 0 && rq->errors == 0)
+ rq->errors = -EIO;
+
ide_end_request(drive, uptodate, nsectors);
}
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index dae9d98..ad9a3f5 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -184,6 +184,8 @@ static ide_startstop_t ide_do_rw_disk(ide_drive_t *drive, struct request *rq,
if (!blk_fs_request(rq)) {
blk_dump_rq_flags(rq, "ide_do_rw_disk - bad command");
+ if (rq->errors == 0)
+ rq->errors = -EIO;
ide_end_request(drive, 0, 0);
return ide_stopped;
}
diff --git a/drivers/ide/ide-eh.c b/drivers/ide/ide-eh.c
index d1385d3..6ad4194 100644
--- a/drivers/ide/ide-eh.c
+++ b/drivers/ide/ide-eh.c
@@ -146,8 +146,11 @@ static inline void ide_complete_drive_reset(ide_drive_t *drive, int err)
{
struct request *rq = drive->hwif->rq;
- if (rq && blk_special_request(rq) && rq->cmd[0] == REQ_DRIVE_RESET)
+ if (rq && blk_special_request(rq) && rq->cmd[0] == REQ_DRIVE_RESET) {
+ if (err <= 0 && rq->errors == 0)
+ rq->errors = -EIO;
ide_end_request(drive, err ? err : 1, 0);
+ }
}
/* needed below */
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
index 407e491..572aa96 100644
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -298,6 +298,8 @@ static ide_startstop_t ide_floppy_do_request(ide_drive_t *drive,
return idefloppy_issue_pc(drive, pc);
out_end:
drive->failed_pc = NULL;
+ if (blk_fs_request(rq) == 0 && rq->errors == 0)
+ rq->errors = -EIO;
ide_end_request(drive, 0, 0);
return ide_stopped;
}
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index 4cc2bb1..28ac463 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -102,9 +102,6 @@ int ide_end_request (ide_drive_t *drive, int uptodate, int nr_sectors)
if (blk_noretry_request(rq) && uptodate <= 0)
nr_bytes = rq->hard_nr_sectors << 9;
- if (blk_fs_request(rq) == 0 && uptodate <= 0 && rq->errors == 0)
- rq->errors = -EIO;
-
if (uptodate <= 0)
error = uptodate ? uptodate : -EIO;
@@ -169,6 +166,8 @@ void ide_kill_rq(ide_drive_t *drive, struct request *rq)
} else {
if (media == ide_tape)
rq->errors = IDE_DRV_ERROR_GENERAL;
+ else if (blk_fs_request(rq) == 0 && rq->errors == 0)
+ rq->errors = -EIO;
ide_end_request(drive, 0, 0);
}
}
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index 3bfcd72..94f6fb8 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -760,6 +760,8 @@ static ide_startstop_t idetape_do_request(ide_drive_t *drive,
/* We do not support buffer cache originated requests. */
printk(KERN_NOTICE "ide-tape: %s: Unsupported request in "
"request queue (%d)\n", drive->name, rq->cmd_type);
+ if (blk_fs_request(rq) == 0 && rq->errors == 0)
+ rq->errors = -EIO;
ide_end_request(drive, 0, 0);
return ide_stopped;
}