From c4009f895818a84ed4c3bb8f826e78d17a6a5b3e Mon Sep 17 00:00:00 2001 From: Ashish Pandey Date: Wed, 8 Jul 2015 12:42:50 +0530 Subject: ec : Implement check for the cluster.heal-timeout values for disperse volume. Problem : User can set wrong values for cluster.heal-timeout using cli. Any value like string, negative numbers or 0 could be set. Solution : Check the value given by user. It should be numerical, non negative and within the range. Change-Id: I5184ef1a11bb2c225f42ac9ccb1ba680a86cfe09 BUG: 1239037 Signed-off-by: Ashish Pandey Reviewed-on: http://review.gluster.org/11573 Tested-by: NetBSD Build System Tested-by: Gluster Build System Reviewed-by: Xavier Hernandez --- xlators/cluster/ec/src/ec.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'xlators/cluster/ec/src/ec.c') diff --git a/xlators/cluster/ec/src/ec.c b/xlators/cluster/ec/src/ec.c index e28f402e6fe..72dc919ded5 100644 --- a/xlators/cluster/ec/src/ec.c +++ b/xlators/cluster/ec/src/ec.c @@ -246,6 +246,8 @@ reconfigure (xlator_t *this, dict_t *options) uint32, failed); GF_OPTION_RECONF ("heal-wait-qlength", heal_wait_qlen, options, uint32, failed); + GF_OPTION_RECONF ("heal-timeout", ec->shd.timeout, options, + int32, failed); ec_configure_background_heal_opts (ec, background_heals, heal_wait_qlen); return 0; @@ -1315,5 +1317,13 @@ struct volume_options options[] = .description = "This option can be used to control number of heals" " that can wait", }, + { .key = {"heal-timeout"}, + .type = GF_OPTION_TYPE_INT, + .min = 60, + .max = INT_MAX, + .default_value = "600", + .description = "time interval for checking the need to self-heal " + "in self-heal-daemon" + }, { } }; -- cgit