Re: [PATCH Linux 2.6.12-rc5-mm1 03/06] blk: make ide use -EOPNOTSUPP instead of -EIO on ABRT_ERR

Tejun Heo
2005-05-29T04:25:25Z

03_blk_ide_eopnotsupp.patch

Use -EOPNOTSUPP instead of -EIO on ABRT_ERR.

Signed-off-by: Tejun Heo <htejun@gmail.com>

ide-io.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletion(-)

Index: blk-fixes/drivers/ide/ide-io.c
===================================================================
--- blk-fixes.orig/drivers/ide/ide-io.c 2005-05-29 13:20:30.000000000 +0900
+++ blk-fixes/drivers/ide/ide-io.c 2005-05-29 13:20:31.000000000 +0900
@@ -305,6 +305,7 @@ void ide_end_drive_cmd (ide_drive_t *dri
ide_hwif_t *hwif = HWIF(drive);
unsigned long flags;
struct request *rq;
+ int uptodate;

spin_lock_irqsave(&ide_lock, flags);
rq = HWGROUP(drive)->rq;
@@ -379,7 +380,10 @@ void ide_end_drive_cmd (ide_drive_t *dri
blkdev_dequeue_request(rq);
HWGROUP(drive)->rq = NULL;
rq->errors = err;
- end_that_request_last(rq, !rq->errors);
+ uptodate = 1;
+ if (err)
+ uptodate = err & ABRT_ERR ? -EOPNOTSUPP : -EIO;
+ end_that_request_last(rq, uptodate);
spin_unlock_irqrestore(&ide_lock, flags);
}