[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sanlock-devel
Subject:    [PATCH] reset: Calling with too many lockspaces is a usage error
From:       Nir Soffer <nsoffer () redhat ! com>
Date:       2014-08-19 0:10:07
Message-ID: 1408407007-22949-1-git-send-email-nsoffer () redhat ! com
[Download RAW message or body]

Previously we complained about ignoring lockspaces, but continue the
operation as usaual, so another program running the sanlk-reset tool
cannot detect the usage error.

Now this will fail with exit code 2 and this message:

    too many lockspaces (max 64)

Signed-off-by: Nir Soffer <nsoffer@redhat.com>
---
 reset/sanlk_reset.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/reset/sanlk_reset.c b/reset/sanlk_reset.c
index 56cada3..6f4978f 100644
--- a/reset/sanlk_reset.c
+++ b/reset/sanlk_reset.c
@@ -559,7 +559,8 @@ int main(int argc, char *argv[])
 		if (i == optind) {
 			cmd = argv[i];
 		} else if (ls_count == MAX_LS) {
-			fprintf(stderr, "ignore lockspace_name %s\n", argv[i]);
+			fprintf(stderr, "too many lockspaces (max %d)\n", MAX_LS);
+			exit(2);
 		} else {
 			ls_names[ls_count] = argv[i];
 			ls_count++;
-- 
1.8.3.1

_______________________________________________
sanlock-devel mailing list
sanlock-devel@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/sanlock-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic