From bbe02d77a5e7fb587787b9bbc06d28ca8419afb3 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Wed, 22 Jan 2014 14:08:45 -0800 Subject: mount.glusterfs/glusterfsd: Add dummy deprecated *fetch-attempts options volfile-max-fetch-attempts and fetch-attempts were not deprecated properly at 'b610f1be7cd71b8f3e51c224c8b6fe0e7366c8cf'. Provide a way for backward compatibility for broken third party apps. Change-Id: I597b50df08823e74691c5a20a4da4d13aab4b7ff BUG: 1045309 Signed-off-by: Harshavardhana Signed-off-by: Humble Chirammal Reviewed-on: http://review.gluster.org/6544 Reviewed-by: Humble Devassy Chirammal Tested-by: Gluster Build System --- glusterfsd/src/glusterfsd.c | 16 ++++++++++++++++ xlators/mount/fuse/utils/mount.glusterfs.in | 6 ++++++ 2 files changed, 22 insertions(+) diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c index 108edc10cf2..098a9169aa4 100644 --- a/glusterfsd/src/glusterfsd.c +++ b/glusterfsd/src/glusterfsd.c @@ -142,6 +142,9 @@ static struct argp_option gf_options[] = { "Mount the filesystem with POSIX ACL support"}, {"selinux", ARGP_SELINUX_KEY, 0, 0, "Enable SELinux label (extened attributes) support on inodes"}, + {"volfile-max-fetch-attempts", ARGP_VOLFILE_MAX_FETCH_ATTEMPTS, "0", + OPTION_HIDDEN, "Maximum number of attempts to fetch the volfile"}, + #ifdef GF_LINUX_HOST_OS {"aux-gfid-mount", ARGP_AUX_GFID_MOUNT_KEY, 0, 0, "Enable access to filesystem through gfid directly"}, @@ -879,6 +882,9 @@ parse_opts (int key, char *arg, struct argp_state *state) case ARGP_DEBUG_KEY: cmd_args->debug_mode = ENABLE_DEBUG_MODE; break; + case ARGP_VOLFILE_MAX_FETCH_ATTEMPTS: + cmd_args->max_connect_attempts = 1; + break; case ARGP_DIRECT_IO_MODE_KEY: if (!arg) @@ -1477,6 +1483,16 @@ parse_cmdline (int argc, char *argv[], glusterfs_ctx_t *ctx) } } + /* + This option was made obsolete but parsing it for backward + compatibility with third party applications + */ + if (cmd_args->max_connect_attempts) { + gf_log ("glusterfs", GF_LOG_WARNING, + "obsolete option '--volfile-max-fetch-attempts" + " or fetch-attempts' was provided"); + } + #ifdef GF_DARWIN_HOST_OS if (cmd_args->mount_point) cmd_args->mac_compat = GF_OPTION_DEFERRED; diff --git a/xlators/mount/fuse/utils/mount.glusterfs.in b/xlators/mount/fuse/utils/mount.glusterfs.in index 2799ec847c0..ff6b524605a 100755 --- a/xlators/mount/fuse/utils/mount.glusterfs.in +++ b/xlators/mount/fuse/utils/mount.glusterfs.in @@ -151,6 +151,9 @@ start_glusterfs () if [ -n "$worm" ]; then cmd_line=$(echo "$cmd_line --worm"); fi + if [ -n "$volfile_max_fetch_attempts" ]; then + cmd_line=$(echo "$cmd_line --volfile-max-fetch-attempts=$volfile_max_fetch_attempts") + fi if [ -n "$fopen_keep_cache" ]; then cmd_line=$(echo "$cmd_line --fopen-keep-cache"); @@ -424,6 +427,9 @@ with_options() "backupvolfile-server") backupvolfile_server=$value ;; + "fetch-attempts") + volfile_max_fetch_attempts=$value + ;; "congestion-threshold") cong_threshold=$value ;; -- cgit