summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRavishankar N <ravishankar@redhat.com>2018-01-30 20:59:23 +0530
committerShyamsundar Ranganathan <srangana@redhat.com>2018-02-06 14:28:04 +0000
commitd52e4b3ff780ee354468a212e130c026ec61f661 (patch)
treec668198f9b8afa0b1550693a8d1dbcce62cadd72
parente16131c58a79a5dc32a1b5c9a8fd18bce1393253 (diff)
afr: capture the correct errno in post-op quorum checkrelease-3.13
If the post-op phase of txn did not meet quorm checks, use that errno to unwind the FOP rather than blindly setting ENOTCONN. Change-Id: I0cb0c8771ec75a45f9a25ad4cd8601103deddf0c BUG: 1536346 Signed-off-by: Ravishankar N <ravishankar@redhat.com> (cherry picked from commit 440a048f24b006c80af3d7bcd0a1f13fe3459d87)
-rw-r--r--xlators/cluster/afr/src/afr-transaction.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/xlators/cluster/afr/src/afr-transaction.c b/xlators/cluster/afr/src/afr-transaction.c
index 3ee92e5..7591f4b 100644
--- a/xlators/cluster/afr/src/afr-transaction.c
+++ b/xlators/cluster/afr/src/afr-transaction.c
@@ -534,8 +534,8 @@ afr_lock_server_count (afr_private_t *priv, afr_transaction_type type)
/* {{{ pending */
-gf_boolean_t
-afr_post_op_has_quorum (afr_local_t *local, xlator_t *this)
+void
+afr_handle_post_op_quorum (afr_local_t *local, xlator_t *this)
{
afr_private_t *priv = NULL;
int i = 0;
@@ -551,10 +551,13 @@ afr_post_op_has_quorum (afr_local_t *local, xlator_t *this)
}
if (afr_has_quorum (post_op_children, this)) {
- return _gf_true;
+ return;
}
- return _gf_false;
+ local->op_ret = -1;
+ /*local->op_errno is already captured in post-op callback.*/
+
+ return;
}
int
@@ -569,10 +572,7 @@ afr_changelog_post_op_done (call_frame_t *frame, xlator_t *this)
int_lock = &local->internal_lock;
/* Fail the FOP if post-op did not succeed on quorum no. of bricks. */
- if (!afr_post_op_has_quorum (local, this)) {
- local->op_ret = -1;
- local->op_errno = ENOTCONN;
- }
+ afr_handle_post_op_quorum (local, this);
if (local->transaction.resume_stub) {
call_resume (local->transaction.resume_stub);