From c3bf3b45a7cf612833c14fc701f751ffc04a7e73 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Mon, 27 Sep 2010 01:57:15 +0000 Subject: access-control: report possible errors in graph during 'init()' Signed-off-by: Amar Tumballi Signed-off-by: Vijay Bellur BUG: 1712 (Error is not logged for a dangling volume) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1712 --- xlators/features/access-control/src/access-control.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'xlators/features/access-control/src') diff --git a/xlators/features/access-control/src/access-control.c b/xlators/features/access-control/src/access-control.c index 7612266680f..34422f9ca0c 100644 --- a/xlators/features/access-control/src/access-control.c +++ b/xlators/features/access-control/src/access-control.c @@ -1833,7 +1833,23 @@ struct xlator_fops fops = { int init (xlator_t *this) { - return 0; + int ret = -1; + + if (!this->children || this->children->next) { + gf_log (this->name, GF_LOG_ERROR, + "FATAL: access-control not configured with " + "exactly one child"); + goto out; + } + + if (!this->parents) { + gf_log (this->name, GF_LOG_WARNING, + "dangling volume. check volfile "); + } + + ret = 0; +out: + return ret; } void -- cgit