summaryrefslogtreecommitdiffstats
path: root/scheduler
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@zresearch.com>2009-05-07 04:16:28 -0700
committerAnand V. Avati <avati@amp.gluster.com>2009-05-08 18:15:40 +0530
commit20e8fc7a61fd22af1657cffa674c287ad29a7699 (patch)
tree69ff54be2cc4c7c08730068c3e7a53941a726b9b /scheduler
parent124f02ed49615e8337d249a2c56e95a5298a856b (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')
-rw-r--r--scheduler/nufa/src/nufa.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/scheduler/nufa/src/nufa.c b/scheduler/nufa/src/nufa.c
index b79241a5055..790704a8fc7 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");