12a457
From ff274ab6b20e448a66b55958452dba8151063433 Mon Sep 17 00:00:00 2001
12a457
From: Pranith Kumar K <pkarampu@redhat.com>
12a457
Date: Tue, 17 May 2016 06:38:57 +0530
12a457
Subject: [PATCH 160/167] cluster/afr: If possible give errno received from lower xlators
12a457
12a457
In case of 3 way replication with quorum enabled with sharding,
12a457
if one bricks is brought down and brought back up sometimes
12a457
fops fail with EROFS because the mknod of shard file fails with
12a457
two good nodes with EEXIST. So even when quorum is not met, it
12a457
makes sense to unwind with the errno returned by lower xlators
12a457
as much as possible.
12a457
12a457
 >Change-Id: Iabd91cd7c270f5dfe6cbd18c50e59c299a331552
12a457
 >BUG: 1336612
12a457
 >Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
12a457
 >Reviewed-on: http://review.gluster.org/14369
12a457
 >Smoke: Gluster Build System <jenkins@build.gluster.com>
12a457
 >NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
12a457
 >CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
12a457
 >Reviewed-by: Ravishankar N <ravishankar@redhat.com>
12a457
12a457
release-3.7: http://review.gluster.org/14452
12a457
12a457
BUG: 1330044
12a457
Change-Id: I5029c666708a0103afefc6ff7a84fecd4a8fae4a
12a457
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
12a457
Reviewed-on: https://code.engineering.redhat.com/gerrit/74759
12a457
Reviewed-by: Ravishankar Narayanankutty <ravishankar@redhat.com>
12a457
Tested-by: Ravishankar Narayanankutty <ravishankar@redhat.com>
12a457
---
12a457
 xlators/cluster/afr/src/afr-transaction.c |    4 +++-
12a457
 1 files changed, 3 insertions(+), 1 deletions(-)
12a457
12a457
diff --git a/xlators/cluster/afr/src/afr-transaction.c b/xlators/cluster/afr/src/afr-transaction.c
12a457
index d83a45c..9c97f75 100644
12a457
--- a/xlators/cluster/afr/src/afr-transaction.c
12a457
+++ b/xlators/cluster/afr/src/afr-transaction.c
12a457
@@ -738,7 +738,9 @@ afr_handle_quorum (call_frame_t *frame)
12a457
         }
12a457
 
12a457
         local->op_ret = -1;
12a457
-        local->op_errno = afr_quorum_errno (priv);
12a457
+        local->op_errno = afr_final_errno (local, priv);
12a457
+        if (local->op_errno == 0)
12a457
+                local->op_errno = afr_quorum_errno (priv);
12a457
 }
12a457
 
12a457
 int
12a457
-- 
12a457
1.7.1
12a457