logo       

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

Subject: Re: [PATCH] propagate IET I/O errors to initiator
From: FUJITA Tomonori <fujita.tomonori@xxxxxxxxxxxxx>
Subject: Re: [Iscsitarget-devel] [PATCH] propagate IET I/O errors to initiator
Date: Thu, 23 Feb 2006 19:08:36 +0900

> > 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 patch is broken. But you see what I like to do.


-------------------------------------------------------
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>