summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@gluster.com>2010-12-13 03:33:21 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-12-14 19:41:47 -0800
commit3fd60a81d3a536cfd005e7fe3171d397d1019067 (patch)
treef14b7f19ccd4c11e6a5248a3c777b453cb6ef50a
parent04fe9457923ff74e9fc396ed13c6a5eef4810493 (diff)
cluster/replicate: fix warnings due to format string mismatches during invocation of gf_log.
Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 2211 ((re)introduce warnings for format string/parameter mismatch) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2211
-rw-r--r--xlators/cluster/afr/src/afr-dir-read.c2
-rw-r--r--xlators/cluster/afr/src/afr-lk-common.c2
-rw-r--r--xlators/cluster/afr/src/afr.c47
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);
}