diff options
author | Amar Tumballi <amar@gluster.com> | 2011-08-20 16:11:02 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2011-08-20 04:47:15 -0700 |
commit | fdb7636bd719e560d9d8c0895a3b80bf3973b9d0 (patch) | |
tree | 0fe79c43b2c6188043141e2d08a89ceafc7165ce /libglusterfs/src | |
parent | 80694bb5ff2f61cfd6e2bb7908add6c853490407 (diff) |
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 <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'libglusterfs/src')
-rw-r--r-- | libglusterfs/src/options.c | 9 |
1 files changed, 9 insertions, 0 deletions
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 <fnmatch.h> #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; |