summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2016-03-30 16:35:09 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2016-03-30 16:35:09 +0000
commitcfb2c4dcba83efa2701eb3e0828d6ad81196b256 (patch)
tree7a8fa408c817ad248c6009288e8bc93f1d667cc0
parentaa7afde9406d782fdb50ae445f5a8f414336b639 (diff)
downloadillumos-joyent-cfb2c4dcba83efa2701eb3e0828d6ad81196b256.tar.gz
OS-5272 lxbrand: tmpfs size option does not accept bytes in K, M, g or G
Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
-rw-r--r--usr/src/lib/brand/lx/lx_brand/common/mount.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/usr/src/lib/brand/lx/lx_brand/common/mount.c b/usr/src/lib/brand/lx/lx_brand/common/mount.c
index 54b607e8f7..905078cc09 100644
--- a/usr/src/lib/brand/lx/lx_brand/common/mount.c
+++ b/usr/src/lib/brand/lx/lx_brand/common/mount.c
@@ -226,11 +226,13 @@ i_lx_opt_verify(char *opts, mount_opt_t *mop)
} else if (mop[i].mo_type == MOUNT_OPT_BYTESIZE) {
int j;
int stage = 0;
+ int suffix;
/*
* Verify that the value is an unsigned integer
- * that ends in a magnitude suffix (i.e. 'k'
- * or 'm') or a '%' character.
+ * that ends in a magnitude suffix (i.e. case
+ * insensitive 'k' 'm' or 'g') or a '%'
+ * character.
*/
for (j = 0; j < ovalue_len; j++) {
switch (stage) {
@@ -256,9 +258,11 @@ i_lx_opt_verify(char *opts, mount_opt_t *mop)
* Allow one (valid) byte
* magnitude character.
*/
- if (ovalue[j] == 'm' ||
- ovalue[j] == 'k' ||
- ovalue[j] == '\%') {
+ suffix = tolower(ovalue[j]);
+ if (suffix == 'k' ||
+ suffix == 'm' ||
+ suffix == 'g' ||
+ suffix == '\%') {
stage = 2;
break;
}