summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
Diffstat (limited to 'xlators')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volume-set.c31
-rw-r--r--xlators/performance/readdir-ahead/src/readdir-ahead.c3
2 files changed, 33 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-set.c b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
index 9e84d248090..736b4ed89c9 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volume-set.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
@@ -1003,6 +1003,36 @@ out:
static int
+validate_rda_cache_limit (glusterd_volinfo_t *volinfo, dict_t *dict,
+ char *key, char *value, char **op_errstr)
+{
+ int ret = 0;
+ uint64_t rda_cache_size = 0;
+
+ ret = gf_string2bytesize_uint64 (value, &rda_cache_size);
+ if (ret < 0)
+ goto out;
+
+ if (rda_cache_size <= (1 * GF_UNIT_GB))
+ goto out;
+
+ /* With release 3.11 the max value of rda_cache_limit is changed from
+ * 1GB to INFINITY. If there are clients older than 3.11 and the value
+ * of rda-cache-limit is set to > 1GB, the older clients will stop
+ * working. Hence if a user is setting rda-cache-limit to > 1GB
+ * ensure that all the clients are 3.11 or greater.
+ */
+ ret = glusterd_check_client_op_version_support (volinfo->volname,
+ GD_OP_VERSION_3_11_0,
+ op_errstr);
+out:
+ gf_msg_debug ("glusterd", 0, "Returning %d", ret);
+
+ return ret;
+}
+
+
+static int
validate_worm_period (glusterd_volinfo_t *volinfo, dict_t *dict, char *key,
char *value, char **op_errstr)
{
@@ -3276,6 +3306,7 @@ struct volopt_map_entry glusterd_volopt_map[] = {
.type = DOC,
.flags = OPT_FLAG_CLIENT_OPT,
.op_version = GD_OP_VERSION_3_9_1,
+ .validate_fn = validate_rda_cache_limit
},
{ .key = "performance.nl-cache-positive-entry",
.voltype = "performance/nl-cache",
diff --git a/xlators/performance/readdir-ahead/src/readdir-ahead.c b/xlators/performance/readdir-ahead/src/readdir-ahead.c
index 2ffcf25d8a7..4e7f2b9a879 100644
--- a/xlators/performance/readdir-ahead/src/readdir-ahead.c
+++ b/xlators/performance/readdir-ahead/src/readdir-ahead.c
@@ -23,6 +23,7 @@
* preloads on the directory.
*/
+#include <math.h>
#include "glusterfs.h"
#include "xlator.h"
#include "call-stub.h"
@@ -739,7 +740,7 @@ struct volume_options options[] = {
{ .key = {"rda-cache-limit"},
.type = GF_OPTION_TYPE_SIZET,
.min = 0,
- .max = 1 * GF_UNIT_GB,
+ .max = INFINITY,
.default_value = "10MB",
.description = "maximum size of cache consumed by readdir-ahead "
"xlator. This value is global and total memory "