----- Original Message -----
From: "David Teigland" <teigland(a)fedoraproject.org>
To: sanlock-devel(a)lists.fedorahosted.org
Sent: Monday, August 11, 2014 5:27:37 PM
Subject: src/lockspace.c
src/lockspace.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
New commits:
commit 47cdae637b7e2ed78ce8d5c1867582859d71dd44
Author: David Teigland <teigland(a)redhat.com>
Date: Mon Aug 11 09:27:04 2014 -0500
sanlock: log error for invalid set_event args
Signed-off-by: David Teigland <teigland(a)redhat.com>
diff --git a/src/lockspace.c b/src/lockspace.c
index 4c31c09..352287e 100644
--- a/src/lockspace.c
+++ b/src/lockspace.c
@@ -1374,11 +1374,11 @@ int lockspace_set_event(struct sanlk_lockspace *ls,
struct sanlk_host_event *he,
uint64_t now;
int i, rv = 0;
- if (!ls->name[0])
- return -EINVAL;
-
- if (!he->host_id || he->host_id > DEFAULT_MAX_HOSTS)
+ if (!ls->name[0] || !he->host_id || he->host_id > DEFAULT_MAX_HOSTS) {
+ log_error("set_event invalid args host_id %llu name %s",
+ (unsigned long long)he->host_id, ls->name);
Now we have to guess which value is the bad value - the lockspace name or the
host id?
I think that a simpler approach where you check single value and warn about
single value is more useful to the the user of this code.
return -EINVAL;
+ }
pthread_mutex_lock(&spaces_mutex);
sp = _search_space(ls->name, NULL, 0, &spaces, NULL, NULL, NULL);
_______________________________________________
sanlock-devel mailing list
sanlock-devel(a)lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/sanlock-devel