cluster: STABLE3 - qdiskd: Warn if we find >1 label with the same name
Lon Hohberger
lon@fedoraproject.org
Fri Feb 27 14:45:00 GMT 2009
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=da3d354a9d8ac4ccdf019543ca840a964a508382
Commit: da3d354a9d8ac4ccdf019543ca840a964a508382
Parent: 22e0aea3b4acbe71dc76b14f146a1ef7b590bfb4
Author: Lon Hohberger <lhh@redhat.com>
AuthorDate: Thu Feb 26 15:23:59 2009 -0500
Committer: Lon Hohberger <lhh@redhat.com>
CommitterDate: Fri Feb 27 09:43:39 2009 -0500
qdiskd: Warn if we find >1 label with the same name
Signed-off-by: Lon Hohberger <lhh@redhat.com>
---
cman/qdisk/main.c | 6 +++++-
cman/qdisk/proc.c | 4 ++--
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/cman/qdisk/main.c b/cman/qdisk/main.c
index 0478c3d..11a7380 100644
--- a/cman/qdisk/main.c
+++ b/cman/qdisk/main.c
@@ -1691,7 +1691,11 @@ main(int argc, char **argv)
ctx.qc_label);
check_stop_cman(&ctx);
goto out;
- }
+ } else if (ret > 0) {
+ clulog_and_print(LOG_WARNING, "%d matches found for "
+ "label '%s'; please use 'device=' "
+ "instead!\n", ret, ctx.qc_label);
+ }
if (ctx.qc_device)
free(ctx.qc_device);
diff --git a/cman/qdisk/proc.c b/cman/qdisk/proc.c
index b4f60dd..28bdd8b 100644
--- a/cman/qdisk/proc.c
+++ b/cman/qdisk/proc.c
@@ -228,7 +228,7 @@ find_partitions(const char *label, char *devname, size_t devlen, int print)
}
}
- if (dargs.count == 1 && label) {
+ if (dargs.count >= 1 && label) {
snprintf(devname, devlen, "%s", dargs.devnode->devpath->path);
}
@@ -245,7 +245,7 @@ find_partitions(const char *label, char *devname, size_t devlen, int print)
return 0;
/* more than one match */
- return 1;
+ return dargs.count;
not_found:
if (dh) {
More information about the Cluster-cvs
mailing list