From 7945121dda340ec8f25711b2ad3ca70b544de967 Mon Sep 17 00:00:00 2001 From: Ravishankar N Date: Fri, 16 Oct 2015 06:23:29 +0530 Subject: afr: do not wind write if pre-op fails on all children 1. When winding the pre-op, transaction.pre_op[i] is set. If the pre-op fails, transaction.failed_subvols[i] is set. If if fails on all chidren, we can directly proceed to unlock (via afr_changelog_post_op_now) without trying to wind the write, fail and then go to unlock. 2. 'fop_subvols' seems to be an unused variable, hence removing it. Change-Id: I9525628daf48082e979b0093fa0478934495e61f BUG: 1272362 Signed-off-by: Ravishankar N Reviewed-on: http://review.gluster.org/12368 Tested-by: NetBSD Build System Tested-by: Gluster Build System Reviewed-by: Pranith Kumar Karampuri Reviewed-by: Anuradha Talur --- xlators/cluster/afr/src/afr-transaction.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'xlators/cluster/afr/src/afr-transaction.c') diff --git a/xlators/cluster/afr/src/afr-transaction.c b/xlators/cluster/afr/src/afr-transaction.c index 915b68ef07d..81d5deeb019 100644 --- a/xlators/cluster/afr/src/afr-transaction.c +++ b/xlators/cluster/afr/src/afr-transaction.c @@ -44,12 +44,16 @@ __afr_txn_write_fop (call_frame_t *frame, xlator_t *this) afr_local_t *local = NULL; afr_private_t *priv = NULL; int call_count = -1; + unsigned char *failed_subvols = NULL; int i = 0; local = frame->local; priv = this->private; - call_count = AFR_COUNT (local->transaction.pre_op, priv->child_count); + failed_subvols = local->transaction.failed_subvols; + + call_count = priv->child_count - AFR_COUNT (failed_subvols, + priv->child_count); if (call_count == 0) { local->transaction.resume (frame, this); -- cgit