public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@us.ibm.com>
To: Jeff Garzik <jeff@garzik.org>
Cc: ltuikov@yahoo.com, mike.redan@bell.ca,
	James.Bottomley@SteelEye.com, alexisb@us.ibm.com,
	linux-scsi <linux-scsi@vger.kernel.org>
Subject: Re: Aic94xx and Linux kernel 2.6.19
Date: Sun, 12 Nov 2006 11:05:31 -0800	[thread overview]
Message-ID: <4557707B.8040701@us.ibm.com> (raw)
In-Reply-To: <834553.41356.qm@web31804.mail.mud.yahoo.com>

Luben Tuikov wrote:

> 3. I never see a crash.  After the transport driver couldn't allocate
>    memory and returned 0xFFFFFFF4 (-ENOMEM), the SATL task is put
>    back on the list of tasks to be executed, task order, NCQ, etc perfectly
>    preserved. (SATL supports NCQ and Full Task Management, btw.)  The second time
>    around* allocation succeeds and the task(s) are executed.  The application
>    client (I/O tester application/whatever, in user space) never detects this,
>    since the task does complete and status is returned to the application client.

Indeed, I had hoped that libata would do a similar thing.  A curious
thing happens, however, when ata_qc_new_init fails to get an ata_queued_cmd:

First, ata_qc_new_init handles the failure like this:
    cmd->result = (DID_OK << 16) | (QUEUE_FULL << 1);
    done(cmd);

Then, we return to ata_scsi_translate and do this:
    err_mem:
        cmd->result = (DID_ERROR << 16);
        done(cmd);

It appears to me (jgarzik, please correct me if I'm wrong) that first we
set a status code indicating that we're ok but the device queue is full
and finish the command,  but then we blow away that status code and
replace it with an error flag and finish the command a second time!
That does not seem to be desirable behavior since we merely want the I/O
to wait until a command slot frees up, not send errors up the block layer.

Perhaps in the err_mem case we should simply exit out of
ata_scsi_translate instead?  I've a quick-and-dirty patch, though I've
not tested it thoroughly yet.

--

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

diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 7af2a4b..5c1fc46 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -1612,9 +1612,9 @@ early_finish:

 err_did:
 	ata_qc_free(qc);
-err_mem:
 	cmd->result = (DID_ERROR << 16);
 	done(cmd);
+err_mem:
 	DPRINTK("EXIT - internal\n");
 	return 0;


  reply	other threads:[~2006-11-12 19:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4D0A3E3121A0504EAEF0FBA7B9576C2608015A07@toroondc914.bell.corp.bce.ca>
2006-11-10 23:53 ` Aic94xx and Linux kernel 2.6.19 Darrick J. Wong
2006-11-11  1:21   ` Luben Tuikov
2006-11-12 19:05     ` Darrick J. Wong [this message]
2006-11-12 19:23       ` Jeff Garzik
2006-11-14  1:53         ` Darrick J. Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4557707B.8040701@us.ibm.com \
    --to=djwong@us.ibm.com \
    --cc=James.Bottomley@SteelEye.com \
    --cc=alexisb@us.ibm.com \
    --cc=jeff@garzik.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=ltuikov@yahoo.com \
    --cc=mike.redan@bell.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox