@@ -16,7 +16,8 @@ char *checker_state_names[] = {
"up",
"shaky",
"ghost",
- "pending"
+ "pending",
+ "timeout",
};
static LIST_HEAD(checkers);
@@ -46,6 +46,10 @@
* PATH_PENDING:
* - Use: All async checkers
* - Description: Indicates a check IO is in flight.
+ *
+ * PATH_TIMEOUT:
+ * - Use: Only tur checker
+ * - Description: Command timed out
*/
enum path_check_state {
PATH_WILD,
@@ -55,6 +59,7 @@ enum path_check_state {
PATH_SHAKY,
PATH_GHOST,
PATH_PENDING,
+ PATH_TIMEOUT,
PATH_MAX_STATE
};
@@ -297,7 +297,7 @@ libcheck_check (struct checker * c)
pthread_cancel(ct->thread);
ct->running = 0;
MSG(c, MSG_TUR_TIMEOUT);
- tur_status = PATH_DOWN;
+ tur_status = PATH_TIMEOUT;
ct->state = PATH_UNCHECKED;
} else {
condlog(3, "%d:%d: tur checker not finished",
@@ -1065,6 +1065,8 @@ pathinfo (struct path *pp, vector hwtable, int mask)
if (pp->state == PATH_UNCHECKED ||
pp->state == PATH_WILD)
goto blank;
+ if (pp->state == PATH_TIMEOUT)
+ pp->state = PATH_DOWN;
} else {
condlog(3, "%s: path inaccessible", pp->dev);
pp->chkrstate = pp->state = path_state;
@@ -335,6 +335,10 @@ snprint_chk_state (char * buff, size_t len, struct path * pp)
return snprintf(buff, len, "shaky");
case PATH_GHOST:
return snprintf(buff, len, "ghost");
+ case PATH_PENDING:
+ return snprintf(buff, len, "i/o pending");
+ case PATH_TIMEOUT:
+ return snprintf(buff, len, "i/o timeout");
default:
return snprintf(buff, len, "undef");
}
The tur checker might run into a timeout, eg when a command is sent but the checker hasn't been able to receive a reply in time. Use a specific 'PATH_TIMEOUT' state for these cases. Signed-off-by: Hannes Reinecke <hare@suse.de> --- libmultipath/checkers.c | 3 ++- libmultipath/checkers.h | 5 +++++ libmultipath/checkers/tur.c | 2 +- libmultipath/discovery.c | 2 ++ libmultipath/print.c | 4 ++++ 5 files changed, 14 insertions(+), 2 deletions(-)