This patch makes disk errors fail the IO instead of getting logged and
ignored.


Fail IO on disk errors
Signed-off-by: Ed L. Cashin <[EMAIL PROTECTED]>

diff -uprN block-2.6-aa/drivers/block/aoe/aoecmd.c 
block-2.6-bb/drivers/block/aoe/aoecmd.c
--- block-2.6-aa/drivers/block/aoe/aoecmd.c     2005-01-25 08:07:33.000000000 
-0500
+++ block-2.6-bb/drivers/block/aoe/aoecmd.c     2005-01-25 10:00:45.000000000 
-0500
@@ -416,7 +416,9 @@ aoecmd_ata_rsp(struct sk_buff *skb)
 
        if (ahin->cmdstat & 0xa9) {     /* these bits cleared on success */
                printk(KERN_CRIT "aoe: aoecmd_ata_rsp: ata error cmd=%2.2Xh "
-                       "stat=%2.2Xh\n", ahout->cmdstat, ahin->cmdstat);
+                       "stat=%2.2Xh from e%ld.%ld\n", 
+                       ahout->cmdstat, ahin->cmdstat,
+                       d->aoemajor, d->aoeminor);
                if (buf)
                        buf->flags |= BUFFL_FAIL;
        } else {
@@ -458,8 +460,8 @@ aoecmd_ata_rsp(struct sk_buff *skb)
        if (buf) {
                buf->nframesout -= 1;
                if (buf->nframesout == 0 && buf->resid == 0) {
-                       n = !(buf->flags & BUFFL_FAIL);
-                       bio_endio(buf->bio, buf->bio->bi_size, 0);
+                       n = (buf->flags & BUFFL_FAIL) ? -EIO : 0;
+                       bio_endio(buf->bio, buf->bio->bi_size, n);
                        mempool_free(buf, d->bufpool);
                }
        }

-- 
  Ed L Cashin <[EMAIL PROTECTED]>

Reply via email to