public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Maik Hampel <m.hampel@gmx.de>
To: James Bottomley <James.Bottomley@SteelEye.com>
Cc: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"erich@areca.com.tw" <erich@areca.com.tw>
Subject: [PATCH] [SCSI] arcmsr: Fix error handling
Date: Fri, 17 Aug 2007 16:23:47 +0200	[thread overview]
Message-ID: <1187360627.2665.8.camel@c64> (raw)

Fixed error handling in queuecommand(), now all READ_ and WRITE_ commands
are aborted in case of RAID is gone. Before only READ_6 and WRITE_6 commands
were aborted.

Signed-off-by: Maik Hampel <m.hampel@gmx.de>
---
diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c
index 0ddfc21..7a001ad 100644
--- a/drivers/scsi/arcmsr/arcmsr_hba.c
+++ b/drivers/scsi/arcmsr/arcmsr_hba.c
@@ -1133,17 +1133,27 @@ static int arcmsr_queue_command(struct scsi_cmnd *cmd,
 		uint8_t block_cmd;
 
 		block_cmd = cmd->cmnd[0] & 0x0f;
-		if (block_cmd == 0x08 || block_cmd == 0x0a) {
-			printk(KERN_NOTICE
-				"arcmsr%d: block 'read/write'"
-				"command with gone raid volume"
-				" Cmd = %2x, TargetId = %d, Lun = %d \n"
-				, acb->host->host_no
-				, cmd->cmnd[0]
-				, target, lun);
-			cmd->result = (DID_NO_CONNECT << 16);
-			cmd->scsi_done(cmd);
-			return 0;
+		switch (block_cmd) {
+			case READ_6:
+			case READ_10:
+			case READ_12:
+			case READ_16:
+			case WRITE_6:
+			case WRITE_10:
+			case WRITE_12:
+			case WRITE_16:
+				printk(KERN_NOTICE
+					"arcmsr%d: block 'read/write'"
+					"command with gone raid volume"
+					" Cmd = %2x, TargetId = %d, Lun = %d \n"
+					, acb->host->host_no
+					, cmd->cmnd[0]
+					, target, lun);
+				cmd->result = (DID_NO_CONNECT << 16);
+				cmd->scsi_done(cmd);
+				return 0;
+			default:
+				break;
 		}
 	}
 	if (atomic_read(&acb->ccboutstandingcount) >=
-- 
1.4.4.4




                 reply	other threads:[~2007-08-17 14:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1187360627.2665.8.camel@c64 \
    --to=m.hampel@gmx.de \
    --cc=James.Bottomley@SteelEye.com \
    --cc=erich@areca.com.tw \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    /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