summaryrefslogtreecommitdiffstats
path: root/xlators/mount/fuse/utils/mount.glusterfs.in
diff options
context:
space:
mode:
authorHarshavardhana <harsha@harshavardhana.net>2013-12-09 08:50:49 -0800
committerVijay Bellur <vbellur@redhat.com>2013-12-15 21:28:53 -0800
commit1bef95812b79ca621fa24f6f99642f0ed6770d7f (patch)
tree4d4aadbc86f640ce487dfd6f4bda201775252f13 /xlators/mount/fuse/utils/mount.glusterfs.in
parentd0caeae1bf8bef6fec778825e7ea5d555ea9ae29 (diff)
mount.glusterfs: Provide backward compatibility for "backup-volfile-servers"
In commit "b610f1be7cd71b8f3e51c224c8b6fe0e7366c8cf" we deprecated "backupvolfile-server" and provided a new option for specifying multiple backup servers. This resulted in existing `fstab` entries invalid and leading to mount failure. Provide backward compatibility to avoid this regression. Change-Id: Ic20671bbe2a0df36b6110ffa928396f808eb76e5 BUG: 1039643 Signed-off-by: Harshavardhana <harsha@harshavardhana.net> Reviewed-on: http://review.gluster.org/6464 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaushal M <kaushal@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/6485 Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/mount/fuse/utils/mount.glusterfs.in')
-rwxr-xr-xxlators/mount/fuse/utils/mount.glusterfs.in22
1 files changed, 22 insertions, 0 deletions
diff --git a/xlators/mount/fuse/utils/mount.glusterfs.in b/xlators/mount/fuse/utils/mount.glusterfs.in
index a192d6059c5..bf89e9d528d 100755
--- a/xlators/mount/fuse/utils/mount.glusterfs.in
+++ b/xlators/mount/fuse/utils/mount.glusterfs.in
@@ -73,6 +73,19 @@ parse_backup_volfile_servers ()
echo ${new_servers}
}
+parse_backupvolfile_server ()
+{
+ local server=$1
+
+ length=$(echo $server | wc -c)
+ if [ ${length} -gt ${HOST_NAME_MAX} ]; then
+ echo "Hostname:${server} provided is too long.. exiting"
+ exit 1
+ fi
+
+ echo ${server}
+}
+
start_glusterfs ()
{
# lets the comparsion be case insensitive for all strings
@@ -207,6 +220,13 @@ start_glusterfs ()
cmd_line=$(echo "$cmd_line --volfile-server=$server_ip");
+ if [ -n "$backupvolfile_server" ]; then
+ if [ -z "$backup_volfile_servers" ]; then
+ server=$(parse_backupvolfile_server ${backupvolfile_server})
+ cmd_line=$(echo "$cmd_line --volfile-server=$server");
+ fi
+ fi
+
if [ -n "$backup_volfile_servers" ]; then
servers=$(parse_backup_volfile_servers ${backup_volfile_servers})
for i in $(echo ${servers}); do
@@ -388,6 +408,8 @@ main ()
"gid-timeout") gid_timeout=$value ;;
"background-qlen") bg_qlen=$value ;;
"backup-volfile-servers") backup_volfile_servers=$value ;;
+ ## Place-holder backward compatibility
+ "backupvolfile-server") backupvolfile_server=$value ;;
"congestion-threshold") cong_threshold=$value ;;
"xlator-option") xlator_option=$xlator_option" "$pair ;;
"fuse-mountopts") fuse_mountopts=$value ;;