From 3fd60a81d3a536cfd005e7fe3171d397d1019067 Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Mon, 13 Dec 2010 03:33:21 +0000 Subject: cluster/replicate: fix warnings due to format string mismatches during invocation of gf_log. Signed-off-by: Raghavendra G Signed-off-by: Anand V. Avati BUG: 2211 ((re)introduce warnings for format string/parameter mismatch) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2211 --- xlators/cluster/afr/src/afr-dir-read.c | 2 +- xlators/cluster/afr/src/afr-lk-common.c | 2 +- xlators/cluster/afr/src/afr.c | 47 ++++++++++++++++++++------------- 3 files changed, 30 insertions(+), 21 deletions(-) diff --git a/xlators/cluster/afr/src/afr-dir-read.c b/xlators/cluster/afr/src/afr-dir-read.c index f52054eaa..19ddcbda7 100644 --- a/xlators/cluster/afr/src/afr-dir-read.c +++ b/xlators/cluster/afr/src/afr-dir-read.c @@ -259,7 +259,7 @@ afr_opendir_cbk (call_frame_t *frame, void *cookie, local->op_ret = -1; local->op_errno = -1; gf_log (this->name, GF_LOG_ERROR, " failed to " - "set fd ctx for fd %d", local->fd); + "set fd ctx for fd %p", local->fd); goto out; } if (!afr_is_opendir_done (this, local->fd->inode) && diff --git a/xlators/cluster/afr/src/afr-lk-common.c b/xlators/cluster/afr/src/afr-lk-common.c index b213826d0..d2f7579fc 100644 --- a/xlators/cluster/afr/src/afr-lk-common.c +++ b/xlators/cluster/afr/src/afr-lk-common.c @@ -1785,7 +1785,7 @@ afr_save_locked_fd (xlator_t *this, fd_t *fd) ret = __afr_save_locked_fd (this, fd); if (ret) { gf_log (this->name, GF_LOG_DEBUG, - "fd=%p could not be saved"); + "fd=%p could not be saved", fd); goto unlock; } } diff --git a/xlators/cluster/afr/src/afr.c b/xlators/cluster/afr/src/afr.c index 5f586e201..9fb6bc04b 100644 --- a/xlators/cluster/afr/src/afr.c +++ b/xlators/cluster/afr/src/afr.c @@ -129,9 +129,10 @@ validate_options (xlator_t *this, dict_t *options, char **op_errstr) temp_ret = gf_string2boolean (self_heal, &data_self_heal); if (temp_ret < 0) { gf_log (this->name, GF_LOG_WARNING, - "Validation failed for data self heal", - self_heal); - *op_errstr = gf_strdup ("Error, option should be boolean"); + "Validation failed for data self heal " + "(given-string = %s)", self_heal); + *op_errstr = gf_strdup ("Error, option should be " + "boolean"); ret = -1; goto out; } @@ -139,7 +140,7 @@ validate_options (xlator_t *this, dict_t *options, char **op_errstr) gf_log (this->name, GF_LOG_DEBUG, "Reconfiguring 'option data" - "-self-heal %s'.", self_heal); + "-self-heal %s'.", self_heal); } dict_ret = dict_get_str (options, "entry-self-heal", @@ -148,9 +149,11 @@ validate_options (xlator_t *this, dict_t *options, char **op_errstr) temp_ret = gf_string2boolean (self_heal, &entry_self_heal); if (temp_ret < 0) { gf_log (this->name, GF_LOG_WARNING, - "Validation faled for entry-self-heal", + "Validation faled for entry-self-heal" + " (given string = %s)", self_heal); - *op_errstr = gf_strdup ("Error, option should be boolean"); + *op_errstr = gf_strdup ("Error, option should be " + "boolean"); ret = -1; goto out; } @@ -158,7 +161,7 @@ validate_options (xlator_t *this, dict_t *options, char **op_errstr) gf_log (this->name, GF_LOG_DEBUG, "Validated 'option entry" - "-self-heal %s'.", self_heal); + "-self-heal %s'.", self_heal); } @@ -168,9 +171,10 @@ validate_options (xlator_t *this, dict_t *options, char **op_errstr) temp_ret = gf_string2boolean (str_readdir, &strict_readdir); if (temp_ret < 0) { gf_log (this->name, GF_LOG_WARNING, - "Validation faled for strict_readdir", - str_readdir); - *op_errstr = gf_strdup ("Error, option should be boolean"); + "Validation faled for strict_readdir " + "(given-string = %s)", str_readdir); + *op_errstr = gf_strdup ("Error, option should be " + "boolean"); ret = -1; goto out; } @@ -178,7 +182,7 @@ validate_options (xlator_t *this, dict_t *options, char **op_errstr) gf_log (this->name, GF_LOG_DEBUG, "Validated 'option strict" - "-readdir %s'.", str_readdir); + "-readdir %s'.", str_readdir); } dict_ret = dict_get_int32 (options, "data-self-heal-window-size", @@ -210,7 +214,8 @@ validate_options (xlator_t *this, dict_t *options, char **op_errstr) if (temp_ret < 0) { gf_log (this->name, GF_LOG_WARNING, "Validation faled for data-change-log"); - *op_errstr = gf_strdup ("Error, option should be boolean"); + *op_errstr = gf_strdup ("Error, option should be " + "boolean"); ret = -1; goto out; } @@ -218,7 +223,7 @@ validate_options (xlator_t *this, dict_t *options, char **op_errstr) gf_log (this->name, GF_LOG_DEBUG, "Validated 'option data-" - "change-log %s'.", change_log); + "change-log %s'.", change_log); } dict_ret = dict_get_str (options, "metadata-change-log", @@ -229,7 +234,8 @@ validate_options (xlator_t *this, dict_t *options, char **op_errstr) if (temp_ret < 0) { gf_log (this->name, GF_LOG_WARNING, "Validation faild for metadata-change-log"); - *op_errstr = gf_strdup ("Error, option should be boolean"); + *op_errstr = gf_strdup ("Error, option should be " + "boolean"); ret = -1; goto out; } @@ -237,7 +243,7 @@ validate_options (xlator_t *this, dict_t *options, char **op_errstr) gf_log (this->name, GF_LOG_DEBUG, "Validated 'option metadata-" - "change-log %s'.", change_log); + "change-log %s'.", change_log); } dict_ret = dict_get_str (options, "entry-change-log", @@ -247,7 +253,8 @@ validate_options (xlator_t *this, dict_t *options, char **op_errstr) if (temp_ret < 0) { gf_log (this->name, GF_LOG_WARNING, "Validation faild for entr-change-log"); - *op_errstr = gf_strdup ("Error, option should be boolean"); + *op_errstr = gf_strdup ("Error, option should be " + "boolean"); ret = -1; goto out; } @@ -262,11 +269,13 @@ validate_options (xlator_t *this, dict_t *options, char **op_errstr) dict_ret = dict_get_str (options, "optimistic-change-log", &change_log); if (dict_ret == 0) { - temp_ret = gf_string2boolean (change_log, &optimistic_change_log); + temp_ret = gf_string2boolean (change_log, + &optimistic_change_log); if (temp_ret < 0) { gf_log (this->name, GF_LOG_WARNING, "Validation faled for optimistic-change-log"); - *op_errstr = gf_strdup ("Error, option should be boolean"); + *op_errstr = gf_strdup ("Error, option should be " + "boolean"); ret = -1; goto out; } @@ -274,7 +283,7 @@ validate_options (xlator_t *this, dict_t *options, char **op_errstr) gf_log (this->name, GF_LOG_DEBUG, "Validated 'option optimistic-" - "change-log %s'.", change_log); + "change-log %s'.", change_log); } -- cgit