From 81e7464a54165b5d8b40847355d3bb6fe7b6e9df Mon Sep 17 00:00:00 2001 From: Kaushal M Date: Wed, 4 Apr 2012 12:00:30 +0530 Subject: libglusterfs : Fix validation for integer volume options. Integer volume options which specified only the min value as 0, would not be validated during "volume set". The range check for an option happened only if both min and max were not 0. In the above case, even though a minium was specified, the range check did not happen as both min and max were 0. To allow forced validation in such cases, a new member, "validate", has been added to volume_options_t. This member takes the values GF_OPT_VALIDATE_BOTH, GF_OPT_VALIDATE_MIN and GF_OPT_VALIDATE_MAX (GF_OPT_VALIDATE_BOTH is the default). Change-Id: I351de0eedb6028120e5c0b073ee5d9c141dee717 BUG: 809847 Signed-off-by: Kaushal M Reviewed-on: http://review.gluster.com/3084 Tested-by: Gluster Build System Reviewed-by: Amar Tumballi Reviewed-by: Anand Avati --- xlators/cluster/afr/src/afr.c | 1 + 1 file changed, 1 insertion(+) (limited to 'xlators/cluster/afr/src/afr.c') diff --git a/xlators/cluster/afr/src/afr.c b/xlators/cluster/afr/src/afr.c index 4f7bf2de0..ebb9f1ee9 100644 --- a/xlators/cluster/afr/src/afr.c +++ b/xlators/cluster/afr/src/afr.c @@ -524,6 +524,7 @@ struct volume_options options[] = { .type = GF_OPTION_TYPE_INT, .min = 0, .default_value = "16", + .validate = GF_OPT_VALIDATE_MIN, }, { .key = {"data-self-heal"}, .type = GF_OPTION_TYPE_STR, -- cgit