summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src
diff options
context:
space:
mode:
authorKrutika Dhananjay <kdhananj@redhat.com>2016-11-08 17:24:41 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2016-11-15 07:22:28 -0800
commitcbfd874034dc659034720f074df79d1288b80bc4 (patch)
tree1ef8c3f72d87b4c19af219136107638b3c932eab /xlators/cluster/afr/src
parent96770bc3c2d44a20cd9fe0b2ca02fac28ae750a1 (diff)
cluster/afr: When failing fop due to lack of quorum, also log error string
Backport of: http://review.gluster.org/#/c/15800/ Change-Id: I11a1321dfd4c49a326886bc92b0f9c08556b4a66 BUG: 1393629 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/15812 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'xlators/cluster/afr/src')
-rw-r--r--xlators/cluster/afr/src/afr-transaction.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/xlators/cluster/afr/src/afr-transaction.c b/xlators/cluster/afr/src/afr-transaction.c
index 663e4034fb2..12d3d9f439d 100644
--- a/xlators/cluster/afr/src/afr-transaction.c
+++ b/xlators/cluster/afr/src/afr-transaction.c
@@ -792,6 +792,16 @@ afr_handle_quorum (call_frame_t *frame)
if (afr_has_fop_cbk_quorum (frame))
return;
+ for (i = 0; i < priv->child_count; i++) {
+ if (local->transaction.pre_op[i])
+ afr_transaction_fop_failed (frame, frame->this, i);
+ }
+
+ local->op_ret = -1;
+ local->op_errno = afr_final_errno (local, priv);
+ if (local->op_errno == 0)
+ local->op_errno = afr_quorum_errno (priv);
+
if (local->fd) {
gf_uuid_copy (gfid, local->fd->inode->gfid);
file = uuid_utoa (gfid);
@@ -800,19 +810,10 @@ afr_handle_quorum (call_frame_t *frame)
file = local->loc.path;
}
- gf_msg (frame->this->name, GF_LOG_WARNING, 0, AFR_MSG_QUORUM_FAIL,
- "%s: Failing %s as quorum is not met",
+ gf_msg (frame->this->name, GF_LOG_WARNING, local->op_errno,
+ AFR_MSG_QUORUM_FAIL, "%s: Failing %s as quorum is not met",
file, gf_fop_list[local->op]);
- for (i = 0; i < priv->child_count; i++) {
- if (local->transaction.pre_op[i])
- afr_transaction_fop_failed (frame, frame->this, i);
- }
-
- local->op_ret = -1;
- local->op_errno = afr_final_errno (local, priv);
- if (local->op_errno == 0)
- local->op_errno = afr_quorum_errno (priv);
switch (local->transaction.type) {
case AFR_ENTRY_TRANSACTION:
case AFR_ENTRY_RENAME_TRANSACTION: