public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libsas: don't use made up error codes
@ 2007-12-30 18:37 James Bottomley
  2007-12-31 21:25 ` Darrick J. Wong
  0 siblings, 1 reply; 3+ messages in thread
From: James Bottomley @ 2007-12-30 18:37 UTC (permalink / raw)
  To: linux-scsi

This is bad for two reasons:

     1. If they're returned to outside applications, no-one knows what
        they mean.
     2. Eventually they'll clash with the ever expanding standard error
        codes.

The problem error code in question is ETASK.  I've replaced this by
ECOMM (communications error on send) a network error code that seems to
most closely relay what ETASK meant.

James

diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c
index 0829b55..adc47d4 100644
--- a/drivers/scsi/libsas/sas_ata.c
+++ b/drivers/scsi/libsas/sas_ata.c
@@ -500,7 +500,7 @@ static int sas_execute_task(struct sas_task *task, void *buffer, int size,
 			goto ex_err;
 		}
 		wait_for_completion(&task->completion);
-		res = -ETASK;
+		res = -ECOMM;
 		if (task->task_state_flags & SAS_TASK_STATE_ABORTED) {
 			int res2;
 			SAS_DPRINTK("task aborted, flags:0x%x\n",
diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c
index 8aeaad9..aefd865 100644
--- a/drivers/scsi/libsas/sas_expander.c
+++ b/drivers/scsi/libsas/sas_expander.c
@@ -96,7 +96,7 @@ static int smp_execute_task(struct domain_device *dev, void *req, int req_size,
 		}
 
 		wait_for_completion(&task->completion);
-		res = -ETASK;
+		res = -ECOMM;
 		if ((task->task_state_flags & SAS_TASK_STATE_ABORTED)) {
 			SAS_DPRINTK("smp task timed out or aborted\n");
 			i->dft->lldd_abort_task(task);
diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h
index 93248cd..a075f13 100644
--- a/include/scsi/libsas.h
+++ b/include/scsi/libsas.h
@@ -91,8 +91,6 @@ enum discover_event {
 
 /* ---------- Expander Devices ---------- */
 
-#define ETASK 0xFA
-
 #define to_dom_device(_obj) container_of(_obj, struct domain_device, dev_obj)
 #define to_dev_attr(_attr)  container_of(_attr, struct domain_dev_attribute,\
                                          attr)



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] libsas: don't use made up error codes
  2007-12-30 18:37 [PATCH] libsas: don't use made up error codes James Bottomley
@ 2007-12-31 21:25 ` Darrick J. Wong
  2007-12-31 21:34   ` James Bottomley
  0 siblings, 1 reply; 3+ messages in thread
From: Darrick J. Wong @ 2007-12-31 21:25 UTC (permalink / raw)
  To: James Bottomley; +Cc: linux-scsi

On Sun, Dec 30, 2007 at 12:37:31PM -0600, James Bottomley wrote:
> This is bad for two reasons:
> 
>      1. If they're returned to outside applications, no-one knows what
>         they mean.
>      2. Eventually they'll clash with the ever expanding standard error
>         codes.
> 
> The problem error code in question is ETASK.  I've replaced this by
> ECOMM (communications error on send) a network error code that seems to
> most closely relay what ETASK meant.

Yay, cleanups :)

Acked-by: Darrick J. Wong <djwong@us.ibm.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] libsas: don't use made up error codes
  2007-12-31 21:25 ` Darrick J. Wong
@ 2007-12-31 21:34   ` James Bottomley
  0 siblings, 0 replies; 3+ messages in thread
From: James Bottomley @ 2007-12-31 21:34 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: linux-scsi


On Mon, 2007-12-31 at 13:25 -0800, Darrick J. Wong wrote:
> On Sun, Dec 30, 2007 at 12:37:31PM -0600, James Bottomley wrote:
> > This is bad for two reasons:
> > 
> >      1. If they're returned to outside applications, no-one knows what
> >         they mean.
> >      2. Eventually they'll clash with the ever expanding standard error
> >         codes.
> > 
> > The problem error code in question is ETASK.  I've replaced this by
> > ECOMM (communications error on send) a network error code that seems to
> > most closely relay what ETASK meant.
> 
> Yay, cleanups :)

Don't get your hopes up ... this was just one that unavoidably crossed
my attention path while I was doing something else.  I'm not going out
looking for these things ... mainly for fear of finding them in large
quantities.

James



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-12-31 21:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-30 18:37 [PATCH] libsas: don't use made up error codes James Bottomley
2007-12-31 21:25 ` Darrick J. Wong
2007-12-31 21:34   ` James Bottomley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox