Re: [PATCH v2] scsi_devinfo: remove synchronous ALUA for NETAPP devices

2016-12-07 Thread Stewart, Sean
On 11/11/16, 10:49 AM, "Xose Vazquez Perez"  wrote:

NetApp did confirm this is not required.

Cc: Martin George 
Cc: Robert Stankey 
Cc: Steven Schremmer 
Cc: Sean Stewart 
Cc: Hannes Reinecke 
Cc: Christophe Varoqui 
Cc: James E.J. Bottomley 
Cc: Martin K. Petersen 
Cc: SCSI ML 
Cc: device-mapper development 
Signed-off-by: Xose Vazquez Perez 
---
 drivers/scsi/scsi_devinfo.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/scsi/scsi_devinfo.c b/drivers/scsi/scsi_devinfo.c
index 2464569..28fea83 100644
--- a/drivers/scsi/scsi_devinfo.c
+++ b/drivers/scsi/scsi_devinfo.c
@@ -220,8 +220,6 @@ static struct {
{"NAKAMICH", "MJ-5.16S", NULL, BLIST_FORCELUN | BLIST_SINGLELUN},
{"NEC", "PD-1 ODX654P", NULL, BLIST_FORCELUN | BLIST_SINGLELUN},
{"NEC", "iStorage", NULL, BLIST_REPORTLUN2},
-   {"NETAPP", "LUN C-Mode", NULL, BLIST_SYNC_ALUA},
-   {"NETAPP", "INF-01-00", NULL, BLIST_SYNC_ALUA},
{"NRC", "MBR-7", NULL, BLIST_FORCELUN | BLIST_SINGLELUN},
{"NRC", "MBR-7.4", NULL, BLIST_FORCELUN | BLIST_SINGLELUN},
{"PIONEER", "CD-ROM DRM-600", NULL, BLIST_FORCELUN | BLIST_SINGLELUN},
-- 
2.10.2

Reviewed-by: Sean Stewart 

Thanks,
Sean



Re: [PATCH] scsi: blacklist all RDAC devices for BLIST_NO_ULD_ATTACH

2016-08-15 Thread Stewart, Sean


On 8/12/16, 5:56 PM, "Xose Vazquez Perez"  wrote:

"Universal Xport" LUN is used for in-band storage array management.

Cc: Sean Stewart 
Cc: Christophe Varoqui 
Cc: James E.J. Bottomley 
Cc: Martin K. Petersen 
Cc: SCSI ML 
Cc: device-mapper development 
Signed-off-by: Xose Vazquez Perez 
---

Acked-by: Sean Stewart  



Re: [PATCH 16/16] scsi_dh_alua: Use workqueue for RTPG

2014-04-29 Thread Stewart, Sean
On Fri, 2014-01-31 at 10:30 +0100, Hannes Reinecke wrote:
 @@ -797,37 +838,40 @@ static int alua_rtpg(struct scsi_device *sdev, struct 
 alua_port_group *pg)
   off = 8 + (ucp[7] * 4);
   }
  
 - sdev_printk(KERN_INFO, sdev,
 - %s: port group %02x state %c %s supports %c%c%c%c%c%c%c\n,
 - ALUA_DH_NAME, pg-group_id, print_alua_state(pg-state),
 - pg-pref ? preferred : non-preferred,
 - valid_statesTPGS_SUPPORT_TRANSITION?'T':'t',
 - valid_statesTPGS_SUPPORT_OFFLINE?'O':'o',
 - valid_statesTPGS_SUPPORT_LBA_DEPENDENT?'L':'l',
 - valid_statesTPGS_SUPPORT_UNAVAILABLE?'U':'u',
 - valid_statesTPGS_SUPPORT_STANDBY?'S':'s',
 - valid_statesTPGS_SUPPORT_NONOPTIMIZED?'N':'n',
 - valid_statesTPGS_SUPPORT_OPTIMIZED?'A':'a');
Hannes,

I was wondering why this was changed from an sdev_printk to a printk? I
can see the AAS of a TPG on a target, but with it this way I do not know
with respect to what logical unit it is.

 + printk(KERN_INFO %s: target %s port group %02x state %c %s 
 +supports %c%c%c%c%c%c%c\n, ALUA_DH_NAME, pg-target_id_str,
 +pg-group_id, print_alua_state(pg-state),
 +pg-pref ? preferred : non-preferred,
 +valid_statesTPGS_SUPPORT_TRANSITION?'T':'t',
 +valid_statesTPGS_SUPPORT_OFFLINE?'O':'o',
 +valid_statesTPGS_SUPPORT_LBA_DEPENDENT?'L':'l',
 +valid_statesTPGS_SUPPORT_UNAVAILABLE?'U':'u',
 +valid_statesTPGS_SUPPORT_STANDBY?'S':'s',
 +valid_statesTPGS_SUPPORT_NONOPTIMIZED?'N':'n',
 +valid_statesTPGS_SUPPORT_OPTIMIZED?'A':'a');
  
  

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


Re: [PATCH] scsi_dh_alua: Requeue another not ready check condition at ML

2014-02-28 Thread Stewart, Sean
On Fri, 2014-02-28 at 16:14 +0100, Hannes Reinecke wrote:
 On 02/28/2014 02:58 AM, Mike Christie wrote:
  On 02/27/2014 06:14 PM, Stewart, Sean wrote:
  This allows the sd driver to retry commands like read capacity until a
  LUN is ready, rather than giving up after three retries.
 
  In NetApp E-Series, a controller can return not ready like this when it
  quiesces I/O on the controller that just came on the network, during a
  firmware upgrade procedure, and retrying the command at the midlayer
  will allow the discovery to complete, successfully.
 
  Signed-off-by: Sean Stewart sean.stew...@netapp.com
  ---
   drivers/scsi/device_handler/scsi_dh_alua.c | 5 +
   1 file changed, 5 insertions(+)
 
  diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c 
  b/drivers/scsi/device_handler/scsi_dh_alua.c
  index 5248c88..95d87fe 100644
  --- a/drivers/scsi/device_handler/scsi_dh_alua.c
  +++ b/drivers/scsi/device_handler/scsi_dh_alua.c
  @@ -454,6 +454,11 @@ static int alua_check_sense(struct scsi_device *sdev,
   {
 switch (sense_hdr-sense_key) {
 case NOT_READY:
  +  if (sense_hdr-asc == 0x04  sense_hdr-ascq == 0x01)
  +  /*
  +   * LUN Not Ready -- In process of becoming ready
  +   */
  +  return ADD_TO_MLQUEUE;
  
  It seems like the check_sense callout is being used to work around
  scsi-ml in a lot of the additions that are not alua specific. If this is
  meant for a specific target then it should not be here. If this is
  non-alua specific behavior then it should also not be here either.
This sounds reasonable to me.  Originally, our target would return a
vendor-specific check condition, and I knew we wouldn't be able to get
the alua handler to retry that.  I also saw if we could get this
condition to return 02/04/0A so we'd be covered, but it wouldn't
accurately describe what's going on, so we set the target to return
02/04/01.

In any case, without having the device handler do ADD_TO_MLQUEUE, I see
the command come back with the check condition, return SUCCESS, then the
read_capacity_10 function burns through it's three retries:
int retries = 3, reset_retries = READ_CAPACITY_RETRIES_ON_RESET;

I captured this with scsi midlayer debugging to show what's going on.
Feb 28 13:51:44 wica-fo-stone kernel: sd 2:0:2:0: Send:
0x880420259cc0
Feb 28 13:51:44 wica-fo-stone kernel: sd 2:0:2:0: CDB: Read
Capacity(10): 25 00 00 00 00 00 00 00 00 00
Feb 28 13:51:45 wica-fo-stone kernel: sd 2:0:2:0: Done:
0x880420259cc0 SUCCESS

The same scsi_cmnd comes back with SUCCESS twice more, then:
Feb 28 13:51:46 wica-fo-stone kernel: sd 2:0:2:0: [sdd] READ CAPACITY
failed

  
  If the IO was not a REQ_TYPE_BLOCK_PC request, then it would retried by
  scsi_io_completion. Same with the other ones like inquiry data changed,
  report luns data changed, etc.
  
  Are we sure we don't want to fix the REQ_TYPE_BLOCK_PC/scsi_execute*
  users to retry, or to add some new flag that those users can use that
  tells scsi-ml to retry like it normally would so callers do not have to
  check for all these errors, or just add these to scsi_decide_disposition?
  
 Yes, that's definitely a better idea. I've stumbled across this
 issue several times now.
Same..  This actually seems to have come up a lot.  We had basically the
same problem when we have a new VID/PID, but a customer uses an OS
without the VID/PID in the RDAC handler.  It can cause a lot of
headaches.

I think it should be possible for us to approach this in such a way that
a transient state on the target won't render the SCSI disk unusable (as
is done here).  So, by a flag, do you mean we could add something to the
request flags field?  We could use this to signify a command that should
keep retrying in the way that I'm looking for here (commands related to
initial discovery, like read capacities, are what I'm thinking of).


Thanks,
Sean


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


[PATCH] scsi_dh_alua: Requeue another not ready check condition at ML

2014-02-27 Thread Stewart, Sean
This allows the sd driver to retry commands like read capacity until a
LUN is ready, rather than giving up after three retries.

In NetApp E-Series, a controller can return not ready like this when it
quiesces I/O on the controller that just came on the network, during a
firmware upgrade procedure, and retrying the command at the midlayer
will allow the discovery to complete, successfully.

Signed-off-by: Sean Stewart sean.stew...@netapp.com
---
 drivers/scsi/device_handler/scsi_dh_alua.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c 
b/drivers/scsi/device_handler/scsi_dh_alua.c
index 5248c88..95d87fe 100644
--- a/drivers/scsi/device_handler/scsi_dh_alua.c
+++ b/drivers/scsi/device_handler/scsi_dh_alua.c
@@ -454,6 +454,11 @@ static int alua_check_sense(struct scsi_device *sdev,
 {
switch (sense_hdr-sense_key) {
case NOT_READY:
+   if (sense_hdr-asc == 0x04  sense_hdr-ascq == 0x01)
+   /*
+* LUN Not Ready -- In process of becoming ready
+*/
+   return ADD_TO_MLQUEUE;
if (sense_hdr-asc == 0x04  sense_hdr-ascq == 0x0a)
/*
 * LUN Not Accessible - ALUA state transition
-- 
1.8.3.1

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


Re: [PATCH 1/2] scsi_dh_alua: ALUA check sense should retry device internal reset unit attention

2014-01-21 Thread Stewart, Sean
Please disregard. Accidentally resent this patch via a script :)

Thanks,
Sean

On Tue, 2014-01-21 at 17:36 -0600, Sean Stewart wrote:
 When the scsi_dh_alua handler issues an RTPG during initialization, if
 it gets 0x06/0x29/0x04 as the sense, it will fail to attach the handler.
 NetApp E-Series returns 0x29/0x00 for power on, and 0x29/0x04 for
 conditions that cause the controller to reboot again.  These conditions
 should be treated identically within the handler.
 
 Signed-off-by: Sean Stewart sean.stew...@netapp.com
 ---
  drivers/scsi/device_handler/scsi_dh_alua.c | 5 +
  1 file changed, 5 insertions(+)
 
 diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c 
 b/drivers/scsi/device_handler/scsi_dh_alua.c
 index 68adb89..78205cc 100644
 --- a/drivers/scsi/device_handler/scsi_dh_alua.c
 +++ b/drivers/scsi/device_handler/scsi_dh_alua.c
 @@ -481,6 +481,11 @@ static int alua_check_sense(struct scsi_device *sdev,
* Power On, Reset, or Bus Device Reset, just retry.
*/
   return ADD_TO_MLQUEUE;
 + if (sense_hdr-asc == 0x29  sense_hdr-ascq == 0x04)
 + /*
 +  * Device internal reset
 +  */
 + return ADD_TO_MLQUEUE;
   if (sense_hdr-asc == 0x2a  sense_hdr-ascq == 0x01)
   /*
* Mode Parameters Changed


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


[PATCH 1/2][RESEND] scsi_dh_alua: ALUA check sense should retry device internal reset unit attention

2013-10-15 Thread Stewart, Sean
When the scsi_dh_alua handler issues an RTPG during initialization, if it gets 
0x06/0x29/0x04 as the sense,
it will fail to attach the handler.  NetApp E-Series returns 0x29/0x00 for 
power on, and 0x29/0x04 for
conditions that cause the controller to reboot again.  These conditions should 
be treated identically within
the handler.

Signed-off-by: Sean Stewart sean.stew...@netapp.com
---
 drivers/scsi/device_handler/scsi_dh_alua.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c 
b/drivers/scsi/device_handler/scsi_dh_alua.c
index 68adb89..78205cc 100644
--- a/drivers/scsi/device_handler/scsi_dh_alua.c
+++ b/drivers/scsi/device_handler/scsi_dh_alua.c
@@ -481,6 +481,11 @@ static int alua_check_sense(struct scsi_device *sdev,
 * Power On, Reset, or Bus Device Reset, just retry.
 */
return ADD_TO_MLQUEUE;
+   if (sense_hdr-asc == 0x29  sense_hdr-ascq == 0x04)
+   /*
+* Device internal reset
+*/
+   return ADD_TO_MLQUEUE;
if (sense_hdr-asc == 0x2a  sense_hdr-ascq == 0x01)
/*
 * Mode Parameters Changed
-- 
1.8.3.1




[PATCH 0/2][RESEND] scsi_dh_alua fixes for NetApp E-Series Storage

2013-10-15 Thread Stewart, Sean
Resending without extra whitespace characters...  Apologies!

This short patch series fixes a couple of issues found while testing the 
scsi_dh_alua 
handler with NetApp E-Series storage, both of which would prevent the handler 
from 
attaching even though TPGS is enabled.

Sean Stewart (2):
  ALUA check sense should retry device internal reset unit attention
  ALUA handler attach should succeed while TPG is transitioning

 drivers/scsi/device_handler/scsi_dh_alua.c | 31 --
 1 file changed, 21 insertions(+), 10 deletions(-)

-- 
1.8.3.1


N�r��yb�X��ǧv�^�)޺{.n�+{{ay�ʇڙ�,j��f���h���z��w���
���j:+v���w�j�mzZ+�ݢj��!�i

[PATCH 2/2][RESEND] scsi_dh_alua: ALUA handler attach should succeed while TPG is transitioning

2013-10-15 Thread Stewart, Sean
During testing, it was discovered that when a device tries to attach to the 
alua handler while in TPG
state of transitioning, the alua_rtpg function will wait for it to exit the 
state before allowing it
to continue. As a result, if the 60 second timeout expires, the alua handler 
will not attach to the
device.

To fix this, I have introduced an input argument to alua_rtpg called 
wait_for_transition.  The idea is
that it will wait for the transition to complete before an activation (because 
the current TPG state has
some bearing in that case), but during a discovery if it is transitioning, it 
will not wait, and will
store the state as standby for the time being.

I believe the precedent exists for this from commit 
c0d289b3e59577532c45ee9110ef81bd7b341272
Since if the device reports a state of transitioning, it can transition to 
other more valid states, and
it has been established TPGS is supported on the device, if it is attaching.

Signed-off-by: Sean Stewart sean.stew...@netapp.com
---
 drivers/scsi/device_handler/scsi_dh_alua.c | 26 --
 1 file changed, 16 insertions(+), 10 deletions(-)

diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c 
b/drivers/scsi/device_handler/scsi_dh_alua.c
index 78205cc..5248c88 100644
--- a/drivers/scsi/device_handler/scsi_dh_alua.c
+++ b/drivers/scsi/device_handler/scsi_dh_alua.c
@@ -522,12 +522,13 @@ static int alua_check_sense(struct scsi_device *sdev,
 /*
  * alua_rtpg - Evaluate REPORT TARGET GROUP STATES
  * @sdev: the device to be evaluated.
+ * @wait_for_transition: if nonzero, wait ALUA_FAILOVER_TIMEOUT seconds for 
device to exit transitioning state
  *
  * Evaluate the Target Port Group State.
  * Returns SCSI_DH_DEV_OFFLINED if the path is
  * found to be unusable.
  */
-static int alua_rtpg(struct scsi_device *sdev, struct alua_dh_data *h)
+static int alua_rtpg(struct scsi_device *sdev, struct alua_dh_data *h, int 
wait_for_transition)
 {
struct scsi_sense_hdr sense_hdr;
int len, k, off, valid_states = 0;
@@ -599,7 +600,7 @@ static int alua_rtpg(struct scsi_device *sdev, struct 
alua_dh_data *h)
else
h-transition_tmo = ALUA_FAILOVER_TIMEOUT;
 
-   if (orig_transition_tmo != h-transition_tmo) {
+   if (wait_for_transition  (orig_transition_tmo != h-transition_tmo)) {
sdev_printk(KERN_INFO, sdev,
%s: transition timeout set to %d seconds\n,
ALUA_DH_NAME, h-transition_tmo);
@@ -637,14 +638,19 @@ static int alua_rtpg(struct scsi_device *sdev, struct 
alua_dh_data *h)
 
switch (h-state) {
case TPGS_STATE_TRANSITIONING:
-   if (time_before(jiffies, expiry)) {
-   /* State transition, retry */
-   interval += 2000;
-   msleep(interval);
-   goto retry;
+   if (wait_for_transition) {
+   if (time_before(jiffies, expiry)) {
+   /* State transition, retry */
+   interval += 2000;
+   msleep(interval);
+   goto retry;
+   }
+   err = SCSI_DH_RETRY;
+   } else {
+   err = SCSI_DH_OK;
}
+
/* Transitioning time exceeded, set port to standby */
-   err = SCSI_DH_RETRY;
h-state = TPGS_STATE_STANDBY;
break;
case TPGS_STATE_OFFLINE:
@@ -678,7 +684,7 @@ static int alua_initialize(struct scsi_device *sdev, struct 
alua_dh_data *h)
if (err != SCSI_DH_OK)
goto out;
 
-   err = alua_rtpg(sdev, h);
+   err = alua_rtpg(sdev, h, 0);
if (err != SCSI_DH_OK)
goto out;
 
@@ -738,7 +744,7 @@ static int alua_activate(struct scsi_device *sdev,
int err = SCSI_DH_OK;
int stpg = 0;
 
-   err = alua_rtpg(sdev, h);
+   err = alua_rtpg(sdev, h, 1);
if (err != SCSI_DH_OK)
goto out;
 
-- 
1.8.3.1




[PATCH 1/2] ALUA check sense should retry device internal reset unit attention

2013-10-14 Thread Stewart, Sean
When the scsi_dh_alua handler issues an RTPG during initialization, if it gets 
0x06/0x29/0x04 as the sense,
it will fail to attach the handler.  NetApp E-Series returns 0x29/0x00 for 
power on, and 0x29/0x04 for
conditions that cause the controller to reboot again.  These conditions should 
be treated identically within
the handler.

Signed-off-by: Sean Stewart sean.stew...@netapp.com
---
 drivers/scsi/device_handler/scsi_dh_alua.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c 
b/drivers/scsi/device_handler/scsi_dh_alua.c
index 68adb89..78205cc 100644
--- a/drivers/scsi/device_handler/scsi_dh_alua.c
+++ b/drivers/scsi/device_handler/scsi_dh_alua.c
@@ -481,6 +481,11 @@ static int alua_check_sense(struct scsi_device *sdev,
 * Power On, Reset, or Bus Device Reset, just retry.
 */
return ADD_TO_MLQUEUE;
+   if (sense_hdr-asc == 0x29  sense_hdr-ascq == 0x04)
+   /*
+* Device internal reset
+*/
+   return ADD_TO_MLQUEUE;
if (sense_hdr-asc == 0x2a  sense_hdr-ascq == 0x01)
/*
 * Mode Parameters Changed
-- 
1.8.3.1

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


[PATCH 0/2] scsi_dh_alua fixes for NetApp E-Series Storage

2013-10-14 Thread Stewart, Sean
This short patch series fixes a couple of issues found while testing the 
scsi_dh_alua 
handler with NetApp E-Series storage, both of which would prevent the handler 
from 
attaching, even though TPGS is enabled. This has been observed to lead to some 
paths 
using the alua handler, some paths using the rdac handler.

Sean Stewart (2):
  ALUA check sense should retry device internal reset unit attention
  ALUA handler attach should succeed while TPG is transitioning

 drivers/scsi/device_handler/scsi_dh_alua.c | 31 --
 1 file changed, 21 insertions(+), 10 deletions(-)

-- 
1.8.3.1

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


[PATCH 2/2] ALUA handler attach should succeed while TPG is transitioning

2013-10-14 Thread Stewart, Sean
During testing, it was discovered that when a device tries to attach to the 
alua handler while in TPG
state of transitioning, the alua_rtpg function will wait for it to exit the 
state before allowing it
to continue. As a result, if the 60 second timeout expires, the alua handler 
will not attach to the
device.

To fix this, I have introduced an input argument to alua_rtpg called 
wait_for_transition.  The idea is
that it will wait for the transition to complete before an activation (because 
the current TPG state has
some bearing in that case), but during a discovery if it is transitioning, it 
will not wait, and will
store the state as standby for the time being.

I believe the precedent exists for this from commit 
c0d289b3e59577532c45ee9110ef81bd7b341272
Since if the device reports a state of transitioning, it can transition to 
other more valid states, and
it has been established TPGS is supported on the device, if it is attaching.

Signed-off-by: Sean Stewart sean.stew...@netapp.com
---
 drivers/scsi/device_handler/scsi_dh_alua.c | 26 --
 1 file changed, 16 insertions(+), 10 deletions(-)

diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c 
b/drivers/scsi/device_handler/scsi_dh_alua.c
index 78205cc..5248c88 100644
--- a/drivers/scsi/device_handler/scsi_dh_alua.c
+++ b/drivers/scsi/device_handler/scsi_dh_alua.c
@@ -522,12 +522,13 @@ static int alua_check_sense(struct scsi_device *sdev,
 /*
  * alua_rtpg - Evaluate REPORT TARGET GROUP STATES
  * @sdev: the device to be evaluated.
+ * @wait_for_transition: if nonzero, wait ALUA_FAILOVER_TIMEOUT seconds for 
device to exit transitioning state
  *
  * Evaluate the Target Port Group State.
  * Returns SCSI_DH_DEV_OFFLINED if the path is
  * found to be unusable.
  */
-static int alua_rtpg(struct scsi_device *sdev, struct alua_dh_data *h)
+static int alua_rtpg(struct scsi_device *sdev, struct alua_dh_data *h, int 
wait_for_transition)
 {
struct scsi_sense_hdr sense_hdr;
int len, k, off, valid_states = 0;
@@ -599,7 +600,7 @@ static int alua_rtpg(struct scsi_device *sdev, struct 
alua_dh_data *h)
else
h-transition_tmo = ALUA_FAILOVER_TIMEOUT;
 
-   if (orig_transition_tmo != h-transition_tmo) {
+   if (wait_for_transition  (orig_transition_tmo != h-transition_tmo)) {
sdev_printk(KERN_INFO, sdev,
%s: transition timeout set to %d seconds\n,
ALUA_DH_NAME, h-transition_tmo);
@@ -637,14 +638,19 @@ static int alua_rtpg(struct scsi_device *sdev, struct 
alua_dh_data *h)
 
switch (h-state) {
case TPGS_STATE_TRANSITIONING:
-   if (time_before(jiffies, expiry)) {
-   /* State transition, retry */
-   interval += 2000;
-   msleep(interval);
-   goto retry;
+   if (wait_for_transition) {
+   if (time_before(jiffies, expiry)) {
+   /* State transition, retry */
+   interval += 2000;
+   msleep(interval);
+   goto retry;
+   }
+   err = SCSI_DH_RETRY;
+   } else {
+   err = SCSI_DH_OK;
}
+
/* Transitioning time exceeded, set port to standby */
-   err = SCSI_DH_RETRY;
h-state = TPGS_STATE_STANDBY;
break;
case TPGS_STATE_OFFLINE:
@@ -678,7 +684,7 @@ static int alua_initialize(struct scsi_device *sdev, struct 
alua_dh_data *h)
if (err != SCSI_DH_OK)
goto out;
 
-   err = alua_rtpg(sdev, h);
+   err = alua_rtpg(sdev, h, 0);
if (err != SCSI_DH_OK)
goto out;
 
@@ -738,7 +744,7 @@ static int alua_activate(struct scsi_device *sdev,
int err = SCSI_DH_OK;
int stpg = 0;
 
-   err = alua_rtpg(sdev, h);
+   err = alua_rtpg(sdev, h, 1);
if (err != SCSI_DH_OK)
goto out;
 
-- 
1.8.3.1

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


[PATCH RESEND] scsi_dh_rdac: Add new IBM 1813 product id to rdac devlist

2013-09-11 Thread Stewart, Sean
Add new IBM product id to the RDAC devlist

Signed-off-by: Sean Stewart sean.stew...@netapp.com
---
diff --git a/drivers/scsi/device_handler/scsi_dh_rdac.c 
b/drivers/scsi/device_handler/scsi_dh_rdac.c
index 69c915a..4b9cf93 100644
--- a/drivers/scsi/device_handler/scsi_dh_rdac.c
+++ b/drivers/scsi/device_handler/scsi_dh_rdac.c
@@ -786,6 +786,7 @@ static const struct scsi_dh_devlist rdac_dev_list[] = {
{IBM, 1742},
{IBM, 1745},
{IBM, 1746},
+   {IBM, 1813},
{IBM, 1814},
{IBM, 1815},
{IBM, 1818},
--
--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] scsi_dh_rdac: Add new IBM 1813 product id to rdac devlist

2013-08-21 Thread Stewart, Sean
Add new IBM product id to the RDAC devlist

Signed-off-by: Sean Stewart sean.stew...@netapp.com
---
diff --git a/drivers/scsi/device_handler/scsi_dh_rdac.c 
b/drivers/scsi/device_handler/scsi_dh_rdac.c
index 69c915a..4b9cf93 100644
--- a/drivers/scsi/device_handler/scsi_dh_rdac.c
+++ b/drivers/scsi/device_handler/scsi_dh_rdac.c
@@ -786,6 +786,7 @@ static const struct scsi_dh_devlist rdac_dev_list[] = {
{IBM, 1742},
{IBM, 1745},
{IBM, 1746},
+   {IBM, 1813},
{IBM, 1814},
{IBM, 1815},
{IBM, 1818},
--
--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[dm-devel] [PATCH] [RESEND] scsi_dh_alua: Add module parameter to allow failover to non preferred path without STPG

2013-04-04 Thread Stewart, Sean
Resending with requested rewording of the parameter description.
Currently ALUA device handler sends STPG command during failover and failback.
Failover can be optimized by implicit failover (by not to sending STPG 
command), when 1 is passed as hwhandler parameter in multipath.conf. ex 2 alua 
1. We may need to pass the parameter through module param for alua device 
handler to optimize failover if incase retain_attached_hwhandler set in 
multipath.conf and hwhandler is set with non-tpgs device handler ex: '1 rdac'.

Signed-off-by: Vijay Chauhan vijay.chau...@netapp.com
Signed-off-by: Sean Stewart sean.stew...@netapp.com

---
--- a/drivers/scsi/device_handler/scsi_dh_alua.c.orig   2013-03-27 
12:18:35.0 +0530
+++ b/drivers/scsi/device_handler/scsi_dh_alua.c2013-03-27 
13:23:16.0 +0530
@@ -710,6 +710,10 @@ static int alua_set_params(struct scsi_d
return result;
 }
 
+static uint optimize_stpg;
+module_param(optimize_stpg, uint, S_IRUGO|S_IWUSR); 
+MODULE_PARM_DESC(optimize_stpg, Allow use of a non-optimized path, 
+rather than sending a STPG, when implicit TPGS is supported (0=No,1=Yes). 
Default is 0.);
+
 /*
  * alua_activate - activate a path
  * @sdev: device on the path to be activated @@ -731,6 +735,9 @@ static int 
alua_activate(struct scsi_dev
if (err != SCSI_DH_OK)
goto out;
 
+   if (optimize_stpg)
+   h-flags |= ALUA_OPTIMIZE_STPG;
+
if (h-tpgs  TPGS_MODE_EXPLICIT) {
switch (h-state) {
case TPGS_STATE_NONOPTIMIZED:
--
--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] scsi_dh_alua: Add module parameter to allow failover to non preferred path without STPG

2013-03-28 Thread Stewart, Sean
Currently ALUA device handler sends STPG command during failover and failback.
Failover can be optimized by implicit failover (by not to sending STPG command),
when 1 is passed as hwhandler parameter in multipath.conf. ex 2 alua 1. We may
need to pass the parameter through module param for alua device handler to 
optimize
failover if incase retain_attached_hwhandler set in multipath.conf and hwhandler
is set with non-tpgs device handler ex: '1 rdac'.

Signed-off-by: Vijay Chauhan vijay.chau...@netapp.com
Signed-off-by: Sean Stewart sean.stew...@netapp.com

---
--- a/drivers/scsi/device_handler/scsi_dh_alua.c.orig   2013-03-27 
12:18:35.0 +0530
+++ b/drivers/scsi/device_handler/scsi_dh_alua.c2013-03-27 
13:23:16.0 +0530
@@ -710,6 +710,10 @@ static int alua_set_params(struct scsi_d
return result;
 }
 
+static uint optimize_stpg;
+module_param(optimize_stpg, uint, S_IRUGO|S_IWUSR);
+MODULE_PARM_DESC(optimize_stpg, Send STPG command for Failover on 
non-preferred path(0=Yes,1=No). Default is 0.);
+
 /*
  * alua_activate - activate a path
  * @sdev: device on the path to be activated
@@ -731,6 +735,9 @@ static int alua_activate(struct scsi_dev
if (err != SCSI_DH_OK)
goto out;
 
+   if (optimize_stpg)
+   h-flags |= ALUA_OPTIMIZE_STPG;
+
if (h-tpgs  TPGS_MODE_EXPLICIT) {
switch (h-state) {
case TPGS_STATE_NONOPTIMIZED:
--
--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html