summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src
diff options
context:
space:
mode:
authorAtin Mukherjee <amukherj@redhat.com>2014-11-28 12:03:24 +0530
committerKrishnan Parthasarathi <kparthas@redhat.com>2014-11-30 22:21:49 -0800
commit4ad587a25ff218248f96696305d505c0d37c82f5 (patch)
treedad9628eba35753c42f1d6bdc91ff7a490a51c89 /xlators/mgmt/glusterd/src
parenta435f62853832d3b5a52ab20227399ea921fc8ce (diff)
glusterd: logging improvement in txn_opinfo getter/setter function
There is a code path (__glusterd_handle_stage_op) where glusterd_get_txn_opinfo may fail to get a valid transaction id if there is no volume name provided in the command, however if this function fails to get a txn id in op state machine then its a serious issue and op-sm is impacted. From debugability aspect gf_log () can never give the consumer of this function, so logging these failures with gf_log_calling_fn is must here. Change-Id: I4937a9fb20cc6a747fd30dcd9fd4936398d0602a BUG: 1168809 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-on: http://review.gluster.org/9207 Reviewed-by: Avra Sengupta <asengupt@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-op-sm.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
index d68901ee4e9..9a9b580d3ed 100644
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
@@ -191,8 +191,8 @@ glusterd_get_txn_opinfo (uuid_t *txn_id, glusterd_op_info_t *opinfo)
GF_ASSERT (priv);
if (!txn_id || !opinfo) {
- gf_log ("", GF_LOG_ERROR,
- "Empty transaction id or opinfo received.");
+ gf_log_callingfn (this->name, GF_LOG_ERROR,
+ "Empty transaction id or opinfo received.");
ret = -1;
goto out;
}
@@ -201,7 +201,7 @@ glusterd_get_txn_opinfo (uuid_t *txn_id, glusterd_op_info_t *opinfo)
uuid_utoa (*txn_id),
(void **) &opinfo_obj);
if (ret) {
- gf_log ("", GF_LOG_ERROR,
+ gf_log_callingfn (this->name, GF_LOG_ERROR,
"Unable to get transaction opinfo "
"for transaction ID : %s",
uuid_utoa (*txn_id));
@@ -210,13 +210,13 @@ glusterd_get_txn_opinfo (uuid_t *txn_id, glusterd_op_info_t *opinfo)
(*opinfo) = opinfo_obj->opinfo;
- gf_log ("", GF_LOG_DEBUG,
+ gf_log (this->name, GF_LOG_DEBUG,
"Successfully got opinfo for transaction ID : %s",
uuid_utoa (*txn_id));
ret = 0;
out:
- gf_log ("", GF_LOG_DEBUG, "Returning %d", ret);
+ gf_log (this->name, GF_LOG_DEBUG, "Returning %d", ret);
return ret;
}
@@ -234,7 +234,8 @@ glusterd_set_txn_opinfo (uuid_t *txn_id, glusterd_op_info_t *opinfo)
GF_ASSERT (priv);
if (!txn_id) {
- gf_log ("", GF_LOG_ERROR, "Empty transaction id received.");
+ gf_log_callingfn (this->name, GF_LOG_ERROR,
+ "Empty transaction id received.");
ret = -1;
goto out;
}
@@ -254,16 +255,16 @@ glusterd_set_txn_opinfo (uuid_t *txn_id, glusterd_op_info_t *opinfo)
uuid_utoa (*txn_id), opinfo_obj,
sizeof(glusterd_txn_opinfo_obj));
if (ret) {
- gf_log ("", GF_LOG_ERROR,
- "Unable to set opinfo for transaction ID : %s",
- uuid_utoa (*txn_id));
+ gf_log_callingfn (this->name, GF_LOG_ERROR,
+ "Unable to set opinfo for transaction"
+ " ID : %s", uuid_utoa (*txn_id));
goto out;
}
}
opinfo_obj->opinfo = (*opinfo);
- gf_log ("", GF_LOG_DEBUG,
+ gf_log (this->name, GF_LOG_DEBUG,
"Successfully set opinfo for transaction ID : %s",
uuid_utoa (*txn_id));
ret = 0;
@@ -272,7 +273,7 @@ out:
if (opinfo_obj)
GF_FREE (opinfo_obj);
- gf_log ("", GF_LOG_DEBUG, "Returning %d", ret);
+ gf_log (this->name, GF_LOG_DEBUG, "Returning %d", ret);
return ret;
}