diff -aurp linux-2.6.3-orig/drivers/block/ll_rw_blk.c linux-2.6.3-ec/drivers/block/ll_rw_blk.c --- linux-2.6.3-orig/drivers/block/ll_rw_blk.c 2004-02-17 19:57:16.000000000 -0800 +++ linux-2.6.3-ec/drivers/block/ll_rw_blk.c 2004-02-18 12:33:50.000000000 -0800 @@ -2456,8 +2456,13 @@ static int __end_that_request_first(stru if (!blk_pc_request(req)) req->errors = 0; - if (!uptodate) { - error = -EIO; + /* + * Most drivers set uptodate to 0 for error and 1 for success. + * MD/DM ready drivers will set 1 for success and a -Exxx + * value to indicate a specific error. + */ + if (uptodate < 1) { + error = (uptodate == 0 ? -EIO : uptodate); if (blk_fs_request(req) && !(req->flags & REQ_QUIET)) printk("end_request: I/O error, dev %s, sector %llu\n", req->rq_disk ? req->rq_disk->disk_name : "?", @@ -2540,7 +2545,7 @@ static int __end_that_request_first(stru /** * end_that_request_first - end I/O on a request * @req: the request being processed - * @uptodate: 0 for I/O error + * @@uptodate: <= 0 to indicate an I/O error. * @nr_sectors: number of sectors to end I/O on * * Description: @@ -2561,7 +2566,7 @@ EXPORT_SYMBOL(end_that_request_first); /** * end_that_request_chunk - end I/O on a request * @req: the request being processed - * @uptodate: 0 for I/O error + * @uptodate: <= 0 to indicate an I/O error. * @nr_bytes: number of bytes to complete * * Description: diff -aurp linux-2.6.3-orig/include/linux/errno.h linux-2.6.3-ec/include/linux/errno.h --- linux-2.6.3-orig/include/linux/errno.h 2004-02-17 19:59:12.000000000 -0800 +++ linux-2.6.3-ec/include/linux/errno.h 2004-02-18 12:45:42.000000000 -0800 @@ -23,6 +23,14 @@ #define EJUKEBOX 528 /* Request initiated, but will not complete before timeout */ #define EIOCBQUEUED 529 /* iocb queued, will get completion event */ +/* Block device error codes */ +#define EFATALDEV 540 /* Fatal device error */ +#define EFATALTRNSPT 541 /* Fatal transport error */ +#define EFATALDRV 542 /* Fatal driver error */ +#define ERETRYDEV 543 /* Device error occured, I/O may be retried */ +#define ERETRYTRNSPT 544 /* Transport error occured, I/O may be retried */ +#define ERETRYDRV 545 /* Driver error occured, I/O may be retried */ + #endif #endif