summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libglusterfs/src/common-utils.c2
-rw-r--r--libglusterfs/src/common-utils.h1
-rwxr-xr-xtests/basic/quota-ancestry-building.t2
-rw-r--r--tests/bugs/quota/bug-1087198.t4
4 files changed, 6 insertions, 3 deletions
diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c
index 1adfdaa1673..f9eea5e5fd0 100644
--- a/libglusterfs/src/common-utils.c
+++ b/libglusterfs/src/common-utils.c
@@ -1493,7 +1493,7 @@ gf_string2bytesize_range (const char *str, uint64_t *n, uint64_t max)
value *= GF_UNIT_TB;
else if (strcasecmp (tail, GF_UNIT_PB_STRING) == 0)
value *= GF_UNIT_PB;
- else
+ else if (strcasecmp (tail, GF_UNIT_B_STRING) != 0)
return -1;
}
diff --git a/libglusterfs/src/common-utils.h b/libglusterfs/src/common-utils.h
index ecf25aa9177..d60ba89db55 100644
--- a/libglusterfs/src/common-utils.h
+++ b/libglusterfs/src/common-utils.h
@@ -60,6 +60,7 @@ void trap (void);
#define GF_UNIT_TB 1099511627776ULL
#define GF_UNIT_PB 1125899906842624ULL
+#define GF_UNIT_B_STRING "B"
#define GF_UNIT_KB_STRING "KB"
#define GF_UNIT_MB_STRING "MB"
#define GF_UNIT_GB_STRING "GB"
diff --git a/tests/basic/quota-ancestry-building.t b/tests/basic/quota-ancestry-building.t
index 1633e497922..0cb154ff146 100755
--- a/tests/basic/quota-ancestry-building.t
+++ b/tests/basic/quota-ancestry-building.t
@@ -22,7 +22,7 @@ TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --attribute-timeout=0
EXPECT 'Started' volinfo_field $V0 'Status';
TEST $CLI volume quota $V0 enable
-TEST $CLI volume quota $V0 limit-usage / 1
+TEST $CLI volume quota $V0 limit-usage / 1B
TEST $CLI volume quota $V0 soft-timeout 0
TEST $CLI volume quota $V0 hard-timeout 0
diff --git a/tests/bugs/quota/bug-1087198.t b/tests/bugs/quota/bug-1087198.t
index ffc43c35acf..5121f1b35a2 100644
--- a/tests/bugs/quota/bug-1087198.t
+++ b/tests/bugs/quota/bug-1087198.t
@@ -47,7 +47,9 @@ TEST $CLI volume quota $V0 enable
TEST $CLI volume quota $V0 alert-time 10
TEST $CLI volume quota $V0 hard-timeout 0
TEST $CLI volume quota $V0 soft-timeout 0
-TEST $CLI volume quota $V0 limit-usage / 200KB
+
+# Set limit to 200KB (204800B)
+TEST $CLI volume quota $V0 limit-usage / 204800B
TEST $CLI volume quota $V0 limit-usage /$QUOTA_LIMIT_DIR 100KB
#16