From eff9a75fd95d98b30d0aaa04903ab42b56951d34 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Wed, 23 May 2012 14:48:09 +0530 Subject: mount.glusterfs : multiple fixes * made log-level and other string comparisons be case insensitive * fixed wrong spelling, wrong command usage in case of brick inode computation * used 'cut' instead of 'tr' as piping the result to read was not working fine in few cases. Change-Id: I9caab481cfd80000b8ef9de7a44006729c88cc1b Signed-off-by: Amar Tumballi BUG: 823403 Reviewed-on: http://review.gluster.com/3413 Tested-by: Gluster Build System Reviewed-by: Emmanuel Dreyfus Reviewed-by: Anand Avati --- xlators/mount/fuse/utils/mount.glusterfs.in | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'xlators/mount/fuse/utils') diff --git a/xlators/mount/fuse/utils/mount.glusterfs.in b/xlators/mount/fuse/utils/mount.glusterfs.in index 2901873e3..c313e552f 100755 --- a/xlators/mount/fuse/utils/mount.glusterfs.in +++ b/xlators/mount/fuse/utils/mount.glusterfs.in @@ -57,8 +57,10 @@ _init () start_glusterfs () { + # lets the comparsion be case insensitive for all strings + if [ -n "$log_level_str" ]; then - case "$log_level_str" in + case "$( echo $log_level_str | tr '[a-z]' '[A-Z]')" in "ERROR") log_level=$LOG_ERROR; ;; @@ -247,7 +249,7 @@ check_recursive_mount () tmp_brick="$brick"; brick="$brick"/..; brick_dev=`${lgetdev} $brick`; - brick_inode=`${gletdev} $brick`; + brick_inode=`${lgetinode} $brick`; if [ "$mnt_inode" -eq "$brick_inode" -a "$mnt_dev" -eq "$brick_dev" ]; then echo ERROR: $mnt_dir is a parent of the brick $tmp_brick; exit 2; @@ -275,7 +277,9 @@ main () # "mount -t glusterfs" sends this, but it's useless. "rw") ;; *) - (echo "$pair" | tr "=" " ")|read key value + key=$(echo "$pair" | cut -f1 -d'='); + value=$(echo "$pair" | cut -f2- -d'='); + # Handle options with values. case "$key" in "log-level") log_level_str=$value ;; -- cgit