[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070308092207.GA17141@joejin-pc.cn.oracle.com>
Date: Thu, 8 Mar 2007 17:22:07 +0800
From: Joe Jin <joe.jin@...cle.com>
To: akpm@...l.org, dgilbert@...erlog.com, James.Bottomley@...elEye.com
Cc: linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org,
haobo.zhou@...cle.com
Subject: [PATCH] [scsi]: Add offline state checking while dispatch a scsi cmd
While a scsi device hw error occured, device's status maybe setting
to SDEV_OFFLINE, So at scsi_dispatch_cmd function, we should checking
if device have offline, if yes, do nothing and just return error to
user directly.
Signed-off-by: Joe Jin <lkmaillist@...il.com>
--
--- linux-2.6.21-rc2/drivers/scsi/scsi.c.orig 2007-03-08 16:50:14.000000000 +0800
+++ linux-2.6.21-rc2/drivers/scsi/scsi.c 2007-03-08 16:52:45.000000000 +0800
@@ -486,10 +486,12 @@
int rtn = 0;
/* check if the device is still usable */
- if (unlikely(cmd->device->sdev_state == SDEV_DEL)) {
- /* in SDEV_DEL we error all commands. DID_NO_CONNECT
- * returns an immediate error upwards, and signals
- * that the device is no longer present */
+ if (unlikely(cmd->device->sdev_state == SDEV_DEL ||
+ cmd->device->sdev_state == SDEV_OFFLINE)) {
+ /* in SDEV_DEL or SDEV_OFFLINE we error all commands.
+ * DID_NO_CONNECT returns an immediate error upwards,
+ * and signals that the device is no longer present
+ */
cmd->result = DID_NO_CONNECT << 16;
atomic_inc(&cmd->device->iorequest_cnt);
__scsi_done(cmd);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists