From c7e30933f67f8ab8619ea28bb82e0907a26fe370 Mon Sep 17 00:00:00 2001 From: Ravishankar N Date: Fri, 23 Oct 2015 11:19:30 +0530 Subject: afr: wind writes only on subvols where preop succeeded 1. Call local->transaction.wind() only on subvols where pre-op succeeded. 2. Update op_errno in afr_changelog_cbk call path. This fixes a bug in commit 7945121dda340ec8f25711b2ad3ca70b544de967 where we return EUCLEAN to the application if pre-op fails on all bricks. Change-Id: Iab8776e49a992e7a255314bba542742f7607f3ec BUG: 1272362 Signed-off-by: Ravishankar N Reviewed-on: http://review.gluster.org/12415 Tested-by: Gluster Build System Tested-by: NetBSD Build System Reviewed-by: Pranith Kumar Karampuri --- xlators/cluster/afr/src/afr-transaction.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'xlators') diff --git a/xlators/cluster/afr/src/afr-transaction.c b/xlators/cluster/afr/src/afr-transaction.c index 81d5deeb019..4c85a4b0d03 100644 --- a/xlators/cluster/afr/src/afr-transaction.c +++ b/xlators/cluster/afr/src/afr-transaction.c @@ -63,7 +63,7 @@ __afr_txn_write_fop (call_frame_t *frame, xlator_t *this) local->call_count = call_count; for (i = 0; i < priv->child_count; i++) { - if (local->transaction.pre_op[i]) { + if (local->transaction.pre_op[i] && !failed_subvols[i]) { local->transaction.wind (frame, this, i); if (!--call_count) @@ -977,8 +977,10 @@ afr_changelog_cbk (call_frame_t *frame, void *cookie, xlator_t *this, priv = this->private; child_index = (long) cookie; - if (op_ret == -1) + if (op_ret == -1) { + local->op_errno = op_errno; afr_transaction_fop_failed (frame, this, child_index); + } if (priv->arbiter_count == 1 && !op_ret) { if (xattr) -- cgit