diff options
authorPranith Kumar K <>2014-11-10 16:19:34 +0530
committerNiels de Vos <>2015-02-11 02:13:46 -0800
commit72e84c17240bc46c1a040cb585c4a3c89c58903d (patch)
parentf2fd96af8e58439562ccb8ff8c41827584c622f4 (diff)
cluster/afr: Preserve errno in case of failures on all subvols
Partly backported from Problem: When quorum is enabled and the fop fails on all the subvolumes, op_errno is set to EROFS which overrides the actual errno returned from bricks. Fix: Don't override the errno when fop fails on all subvols. PS: Afr-v2 code differs from afr-v1 so that pre-op part of code doesn't apply Change-Id: I61e57bbf1a69407230ec172a983de18d1c624fd2 BUG: 1162150 Signed-off-by: Pranith Kumar K <> Reviewed-on: Tested-by: Gluster Build System <> Reviewed-by: Niels de Vos <>
1 files changed, 3 insertions, 0 deletions
diff --git a/xlators/cluster/afr/src/afr-transaction.c b/xlators/cluster/afr/src/afr-transaction.c
index 01839f5e..cf7d6bf 100644
--- a/xlators/cluster/afr/src/afr-transaction.c
+++ b/xlators/cluster/afr/src/afr-transaction.c
@@ -722,6 +722,9 @@ afr_handle_quorum (call_frame_t *frame)
if (priv->quorum_count == 0)
+ /* If the fop already failed return right away to preserve errno */
+ if (local->op_ret == -1)
+ return;
* Network split may happen just after the fops are unwound, so check