From fdb7636bd719e560d9d8c0895a3b80bf3973b9d0 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Sat, 20 Aug 2011 16:11:02 +0530 Subject: while validating options, make sure memory accounting is init()ed. Change-Id: Ifad5827c6b022de7d84e081ce77effda0c245a13 BUG: 3415 Reviewed-on: http://review.gluster.com/277 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- libglusterfs/src/options.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libglusterfs/src/options.c b/libglusterfs/src/options.c index ccd57e4f0..b64b24e04 100644 --- a/libglusterfs/src/options.c +++ b/libglusterfs/src/options.c @@ -25,6 +25,7 @@ #include #include "xlator.h" +#include "defaults.h" #define GF_OPTION_LIST_EMPTY(_opt) (_opt->value[0] == NULL) @@ -727,6 +728,14 @@ xlator_validate_rec (xlator_t *xlator, char **op_errstr) old_THIS = THIS; THIS = xlator; + + /* Need this here, as this graph has not yet called init() */ + if (!xlator->mem_acct.num_types) { + if (!xlator->mem_acct_init) + xlator->mem_acct_init = default_mem_acct_init; + xlator->mem_acct_init (xlator); + } + ret = xlator_options_validate (xlator, xlator->options, op_errstr); THIS = old_THIS; -- cgit