Handle SCSI device states "quiesce" and "transport-offline" properly
PATCH 1/1 Handle SCSI device states "quiesce" and "transport-offline" properly
Signed-off-by Bart Van Assche <[email protected]>
--- libmultipath/discovery.c | 5 +++-- libmultipath/structs.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-)
libmultipath/discovery.c +3 -2
@@ -797,12 +797,13 @@ path_offline (struct path * pp)condlog (3 ,"%s: path state = %s" , pp->dev, buff); -if (!strncmp (buff,"offline" ,7 )) { +if (!strncmp (buff,"offline" ,7 ) || + !strncmp (buff,"transport-offline" ,17 )) { pp->offline =1 ;return PATH_DOWN ; } pp->offline =0 ; -if (!strncmp (buff,"blocked" ,7 )) +if (!strncmp (buff,"blocked" ,7 ) || !strncmp (buff,"quiesce" ,7 ))return PATH_PENDING ;else if (!strncmp (buff,"running" ,7 ))return PATH_UP ;
libmultipath/structs.h +1 -1
@@ -20,7 +20,7 @@#define SCSI_VENDOR_SIZE 9#define SCSI_PRODUCT_SIZE 17#define SCSI_REV_SIZE 5 -#define SCSI_STATE_SIZE 9 +#define SCSI_STATE_SIZE 19#define NO_PATH_RETRY_UNDEF 0#define NO_PATH_RETRY_FAIL -1
Signature · 1 line
1.7.10.4
Patch looks ok to me. When I added transport-offline to scsi-ml, I forgot to modify userspace apps. Thanks for fixing.
For the second part, I think it makes sense to handle quiesce like blocked since drivers use that state like how fc/iscsi use blocked.
Reviewed-by Mike Christie <[email protected]>
Quoted 40 lines · Bart Van Assche
Signed-off-by Bart Van Assche <[email protected]>--- libmultipath/discovery.c | 5 +++-- libmultipath/structs.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-)libmultipath/discovery.c +3
-2@@ -797,12 +797,13 @@ path_offline (struct path * pp)condlog (3 ,"%s: path state = %s" , pp->dev, buff); -if (!strncmp (buff,"offline" ,7 )) { +if (!strncmp (buff,"offline" ,7 ) || + !strncmp (buff,"transport-offline" ,17 )) { pp->offline =1 ;return PATH_DOWN ; } pp->offline =0 ; -if (!strncmp (buff,"blocked" ,7 )) +if (!strncmp (buff,"blocked" ,7 ) || !strncmp (buff,"quiesce" ,7 ))return PATH_PENDING ;else if (!strncmp (buff,"running" ,7 ))return PATH_UP ;libmultipath/structs.h +1
-1@@ -20,7 +20,7 @@#define SCSI_VENDOR_SIZE 9#define SCSI_PRODUCT_SIZE 17#define SCSI_REV_SIZE 5 -#define SCSI_STATE_SIZE 9 +#define SCSI_STATE_SIZE 19#define NO_PATH_RETRY_UNDEF 0#define NO_PATH_RETRY_FAIL -1
Christophe Varoqui
AppliedQuoted 2 lines · Bart Van Assche
Signed-off-by Bart Van Assche <[email protected]>---
Applied.
Thanks,
Christophe Varoqui
www.opensvc.com
Quoted 37 lines
libmultipath/discovery.c | 5 +++-- libmultipath/structs.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-)libmultipath/discovery.c +3
-2@@ -797,12 +797,13 @@ path_offline (struct path * pp)condlog (3 ,"%s: path state = %s" , pp->dev, buff); -if (!strncmp (buff,"offline" ,7 )) { +if (!strncmp (buff,"offline" ,7 ) || + !strncmp (buff,"transport-offline" ,17 )) { pp->offline =1 ;return PATH_DOWN ; } pp->offline =0 ; -if (!strncmp (buff,"blocked" ,7 )) +if (!strncmp (buff,"blocked" ,7 ) || !strncmp (buff,"quiesce" ,7 ))return PATH_PENDING ;else if (!strncmp (buff,"running" ,7 ))return PATH_UP ;libmultipath/structs.h +1
-1@@ -20,7 +20,7 @@#define SCSI_VENDOR_SIZE 9#define SCSI_PRODUCT_SIZE 17#define SCSI_REV_SIZE 5 -#define SCSI_STATE_SIZE 9 +#define SCSI_STATE_SIZE 19#define NO_PATH_RETRY_UNDEF 0#define NO_PATH_RETRY_FAIL -1