diff options
author | Raghavendra G <raghavendra@zresearch.com> | 2009-05-07 04:16:28 -0700 |
---|---|---|
committer | Anand V. Avati <avati@amp.gluster.com> | 2009-05-08 18:15:40 +0530 |
commit | 20e8fc7a61fd22af1657cffa674c287ad29a7699 (patch) | |
tree | 69ff54be2cc4c7c08730068c3e7a53941a726b9b /scheduler/nufa | |
parent | 124f02ed49615e8337d249a2c56e95a5298a856b (diff) |
scheduler-nufa: fix initialization of refresh-interval
- refresh-interval was being reported as not provided in the options
even when configured.
- fixes bug reported in rt #1007
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'scheduler/nufa')
-rw-r--r-- | scheduler/nufa/src/nufa.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/scheduler/nufa/src/nufa.c b/scheduler/nufa/src/nufa.c index b79241a5..790704a8 100644 --- a/scheduler/nufa/src/nufa.c +++ b/scheduler/nufa/src/nufa.c @@ -89,14 +89,16 @@ nufa_init (xlator_t *xl) nufa_buf->min_free_disk = NUFA_LIMITS_MIN_FREE_DISK_DEFAULT; } data = dict_get (xl->options, "scheduler.refresh-interval"); - if (data && (gf_string2time (data->data, - &nufa_buf->refresh_interval) != 0)) { - gf_log ("nufa", GF_LOG_ERROR, - "invalid number format \"%s\" of " - "\"option scheduler.refresh-interval\"", - data->data); - return -1; - } else { + if (data != NULL) { + if (gf_string2time (data->data, + &nufa_buf->refresh_interval) != 0) { + gf_log ("nufa", GF_LOG_ERROR, + "invalid number format \"%s\" of " + "\"option scheduler.refresh-interval\"", + data->data); + return -1; + } + } else { gf_log ("nufa", GF_LOG_WARNING, "No option for scheduler.refresh-interval given, " "defaulting it to 30"); |