logo       

Re: [PATCH] propagate IET I/O errors to initiator: msg#00159

Subject: Re: [PATCH] propagate IET I/O errors to initiator
From: Arne Redlich <arne.redlich@xxxxxxxxxxx>
Subject: [Iscsitarget-devel] [PATCH] propagate IET I/O errors to initiator
Date: Wed, 22 Feb 2006 18:26:29 +0100

> This patch fixes a rather nasty behaviour (bug?): in case of I/O errors,
> IET doesn't notify the initiator and instead lets it believe the I/O
> operation succeeded.

I think that I've mentioned this issue several times. This is one of
the well-know issues.


> Please note that the patch below is not extensively tested. It also
> introduces a new struct iscsi_sense_hdr which is apparently somewhat
> close to struct scsi_sense_hdr from <scsi/scsi_eh.h>. I'd happily
> replace the former with the latter if you think it would be beneficial.

I don't think that we will implement the complete error handling. So
can we do this in a simple way? I've attached changes to
send_data_rsp(). I think that you can do similar changes to
send_scsi_rsp().


Index: kernel/iscsi.c
===================================================================
--- kernel/iscsi.c      (revision 28)
+++ kernel/iscsi.c      (working copy)
@@ -372,12 +372,20 @@
 void send_data_rsp(struct iscsi_cmnd *req, int (*func)(struct iscsi_cmnd *))
 {
        struct iscsi_cmnd *rsp;
+       int err;
 
-       if (func(req) < 0) {
+       err = func(req);
+
+       switch (err) {
+       case 0:
+               do_send_data_rsp(req);
+               break;
+       case -EIO:
+               rsp = create_sense_rsp(req, MEDIUM_ERROR, 0x11, 0x0);
+       default:
                rsp = create_sense_rsp(req, ILLEGAL_REQUEST, 0x24, 0x0);
                iscsi_cmnd_init_write(rsp);
-       } else
-               do_send_data_rsp(req);
+       }
 }
 
 /**


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642


<Prev in Thread] Current Thread [Next in Thread>