diff options
author | Harshavardhana <harsha@harshavardhana.net> | 2013-12-09 08:50:49 -0800 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2013-12-10 09:26:20 -0800 |
commit | 980fb894798240076142ea74b0d49dd2b4160462 (patch) | |
tree | 38b6ae87c07a9223e86e56707d5e5c5de46fbfcc /xlators/mount | |
parent | 00b159840added72099f61f45b38133e856d23bf (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>
Diffstat (limited to 'xlators/mount')
-rwxr-xr-x | xlators/mount/fuse/utils/mount.glusterfs.in | 22 |
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 ;; |