From 2e5150be0ad662f218a5442bd1c40f12c825022d Mon Sep 17 00:00:00 2001 From: David Teigland Date: Jun 30 2014 18:36:42 +0000 Subject: sanlock: fix get_hosts off by one When a host_id is specified, the information for host_id+1 is returned. Signed-off-by: David Teigland --- diff --git a/src/lockspace.c b/src/lockspace.c index e96e1e1..6306ea7 100644 --- a/src/lockspace.c +++ b/src/lockspace.c @@ -1078,7 +1078,7 @@ int get_hosts(struct sanlk_lockspace *ls, char *buf, int *len, int *count, int m for (i = 0; i < DEFAULT_MAX_HOSTS; i++) { hs = &sp->host_status[i]; - if (ls->host_id && ls->host_id != i) + if (ls->host_id && (ls->host_id != (i + 1))) continue; if (!ls->host_id && !hs->timestamp)