From d06e6bac4b5aa6d0fbf1660b92c4100de8f79e68 Mon Sep 17 00:00:00 2001 From: vmallika Date: Wed, 1 Apr 2015 16:56:00 +0530 Subject: quota/cli: validate quota hard-limit option Quota hard-limit is supported only upto: 9223372036854775807 (int 64) In CLI, it is allowed to set the value upto 16384PB (unsigned int 64), this is not a valid value as the xattrop for quota accounting and the quota enforcer operates on a signed int64 limit value. This patches fixes the problem in CLI and allows user to set the hard-limit value only from range 0 - 9223372036854775807 Change-Id: Ifce6e509e1832ef21d3278bacfa5bd71040c8cba BUG: 1206432 Signed-off-by: vmallika Reviewed-on: http://review.gluster.org/10022 Tested-by: Gluster Build System Reviewed-by: Kaushal M Reviewed-by: Vijay Bellur --- libglusterfs/src/common-utils.h | 1 + 1 file changed, 1 insertion(+) (limited to 'libglusterfs/src/common-utils.h') diff --git a/libglusterfs/src/common-utils.h b/libglusterfs/src/common-utils.h index ec7e772e6cb..a93c6233a4e 100644 --- a/libglusterfs/src/common-utils.h +++ b/libglusterfs/src/common-utils.h @@ -604,6 +604,7 @@ int gf_string2uint64_base10 (const char *str, uint64_t *n); int gf_string2bytesize (const char *str, uint64_t *n); int gf_string2bytesize_size (const char *str, size_t *n); int gf_string2bytesize_uint64 (const char *str, uint64_t *n); +int gf_string2bytesize_int64 (const char *str, int64_t *n); int gf_string2percent_or_bytesize (const char *str, double *n, gf_boolean_t *is_percent); -- cgit