Return 'ghost' state when port is in standby
authorHannes Reinecke <hare@suse.de>
Thu, 19 Feb 2009 15:19:45 +0000 (16:19 +0100)
committerChristophe Varoqui <christophe.varoqui@free.fr>
Tue, 21 Apr 2009 23:51:28 +0000 (01:51 +0200)
Currently, issuing a TUR command on a path in standby
mode, it returns a Unit Attention status. This is
reported as a Failed path by the SLES11 tur checker.
Instead, this has to be reported as Ghost path based
on the additional sense code and sense code qualifier values.

References: 475816

Signed-off-by: Hannes Reinecke <hare@suse.de>
libmultipath/checkers/tur.c

index aa6e3adb8eefae231af3de453152ed238b0fbd35..e06dc528e89e3891810aa4a8f167ffd52289518c 100644 (file)
@@ -22,6 +22,7 @@
 
 #define MSG_TUR_UP     "tur checker reports path is up"
 #define MSG_TUR_DOWN   "tur checker reports path is down"
+#define MSG_TUR_GHOST  "tur checker reports path is in standby state"
 
 struct tur_checker_context {
        void * dummy;
@@ -95,6 +96,18 @@ libcheck_check (struct checker * c)
                        if (--retry_tur)
                                goto retry;
                }
+               else if (key == 0x2) {
+                       /* Not Ready */
+                       /* Note: Other ALUA states are either UP or DOWN */
+                       if( asc == 0x04 && ascq == 0x0b){
+                               /*
+                                * LOGICAL UNIT NOT ACCESSIBLE,
+                                * TARGET PORT IN STANDBY STATE
+                                */
+                               MSG(c, MSG_TUR_GHOST);
+                               return PATH_GHOST;
+                       }
+               }
                MSG(c, MSG_TUR_DOWN);
                return PATH_DOWN;
        }