linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] aacraid bad queuecommand return
@ 2004-11-19  8:59 Jens Axboe
  0 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2004-11-19  8:59 UTC (permalink / raw)
  To: linux-scsi, James Bottomley

Hi,

aac_read() and aac_write() may complete a command but return -1, which
is propagated through aac_scsi_cmd() to the mid layer through
->queuecommand. If the command has been completed, it must return 0.

Signed-off-by: Jens Axboe <axboe@suse.de>


===== drivers/scsi/aacraid/aachba.c 1.29 vs edited =====
--- 1.29/drivers/scsi/aacraid/aachba.c	2004-10-01 17:10:08 +02:00
+++ edited/drivers/scsi/aacraid/aachba.c	2004-11-18 23:10:40 +01:00
@@ -894,7 +894,7 @@ int aac_read(struct scsi_cmnd * scsicmd,
 	aac_io_done(scsicmd);
 	fib_complete(cmd_fibcontext);
 	fib_free(cmd_fibcontext);
-	return -1;
+	return 0;
 }
 
 static int aac_write(struct scsi_cmnd * scsicmd, int cid)
@@ -928,7 +928,7 @@ static int aac_write(struct scsi_cmnd * 
 	if (!(cmd_fibcontext = fib_alloc(dev))) {
 		scsicmd->result = DID_ERROR << 16;
 		aac_io_done(scsicmd);
-		return -1;
+		return 0;
 	}
 	fib_init(cmd_fibcontext);
 
@@ -1004,7 +1004,7 @@ static int aac_write(struct scsi_cmnd * 
 
 	fib_complete(cmd_fibcontext);
 	fib_free(cmd_fibcontext);
-	return -1;
+	return 0;
 }
 
 
-- 
Jens Axboe


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

* RE: [PATCH] aacraid bad queuecommand return
@ 2004-11-19 12:32 Salyzyn, Mark
  2004-11-19 12:41 ` Jens Axboe
  0 siblings, 1 reply; 4+ messages in thread
From: Salyzyn, Mark @ 2004-11-19 12:32 UTC (permalink / raw)
  To: Jens Axboe, linux-scsi, James Bottomley

In the patch I supplied, I dropped the result setting and aac_io_done
and let the midlayer retry on the none-zero return.

Which is more efficient?

Sincerely -- Mark Salyzyn

-----Original Message-----
From: linux-scsi-owner@vger.kernel.org
[mailto:linux-scsi-owner@vger.kernel.org] On Behalf Of Jens Axboe
Sent: Friday, November 19, 2004 3:59 AM
To: linux-scsi@vger.kernel.org; James Bottomley
Subject: [PATCH] aacraid bad queuecommand return

Hi,

aac_read() and aac_write() may complete a command but return -1, which
is propagated through aac_scsi_cmd() to the mid layer through
->queuecommand. If the command has been completed, it must return 0.

Signed-off-by: Jens Axboe <axboe@suse.de>


===== drivers/scsi/aacraid/aachba.c 1.29 vs edited =====
--- 1.29/drivers/scsi/aacraid/aachba.c	2004-10-01 17:10:08 +02:00
+++ edited/drivers/scsi/aacraid/aachba.c	2004-11-18 23:10:40
+01:00
@@ -894,7 +894,7 @@ int aac_read(struct scsi_cmnd * scsicmd,
 	aac_io_done(scsicmd);
 	fib_complete(cmd_fibcontext);
 	fib_free(cmd_fibcontext);
-	return -1;
+	return 0;
 }
 
 static int aac_write(struct scsi_cmnd * scsicmd, int cid)
@@ -928,7 +928,7 @@ static int aac_write(struct scsi_cmnd * 
 	if (!(cmd_fibcontext = fib_alloc(dev))) {
 		scsicmd->result = DID_ERROR << 16;
 		aac_io_done(scsicmd);
-		return -1;
+		return 0;
 	}
 	fib_init(cmd_fibcontext);
 
@@ -1004,7 +1004,7 @@ static int aac_write(struct scsi_cmnd * 
 
 	fib_complete(cmd_fibcontext);
 	fib_free(cmd_fibcontext);
-	return -1;
+	return 0;
 }
 
 
-- 
Jens Axboe

-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] aacraid bad queuecommand return
  2004-11-19 12:32 [PATCH] aacraid bad queuecommand return Salyzyn, Mark
@ 2004-11-19 12:41 ` Jens Axboe
  0 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2004-11-19 12:41 UTC (permalink / raw)
  To: Salyzyn, Mark; +Cc: linux-scsi, James Bottomley

On Fri, Nov 19 2004, Salyzyn, Mark wrote:
> In the patch I supplied, I dropped the result setting and aac_io_done
> and let the midlayer retry on the none-zero return.
> 
> Which is more efficient?

It doesn't really matter - this path should basically never be hit
(or you would have seen a report, it would hang the scsi layer), so
efficiency isn't really an issue. So just do whatever you see fit,
either way will work fine. I like the scsi_done approach best, because
it allows you to flag more fine grained errors.

-- 
Jens Axboe


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

* RE: [PATCH] aacraid bad queuecommand return
@ 2004-11-19 12:58 Salyzyn, Mark
  0 siblings, 0 replies; 4+ messages in thread
From: Salyzyn, Mark @ 2004-11-19 12:58 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-scsi, James Bottomley

Cool, I'll buy it!!!

-----Original Message-----
From: Jens Axboe [mailto:axboe@suse.de] 
Sent: Friday, November 19, 2004 7:41 AM
To: Salyzyn, Mark
Cc: linux-scsi@vger.kernel.org; James Bottomley
Subject: Re: [PATCH] aacraid bad queuecommand return

On Fri, Nov 19 2004, Salyzyn, Mark wrote:
> In the patch I supplied, I dropped the result setting and aac_io_done
> and let the midlayer retry on the none-zero return.
> 
> Which is more efficient?

It doesn't really matter - this path should basically never be hit
(or you would have seen a report, it would hang the scsi layer), so
efficiency isn't really an issue. So just do whatever you see fit,
either way will work fine. I like the scsi_done approach best, because
it allows you to flag more fine grained errors.

-- 
Jens Axboe


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

end of thread, other threads:[~2004-11-19 12:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-19 12:32 [PATCH] aacraid bad queuecommand return Salyzyn, Mark
2004-11-19 12:41 ` Jens Axboe
  -- strict thread matches above, loose matches on Subject: below --
2004-11-19 12:58 Salyzyn, Mark
2004-11-19  8:59 Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).