summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRavishankar N <ravishankar@redhat.com>2015-10-23 11:19:30 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2015-10-26 01:29:08 -0700
commitc7e30933f67f8ab8619ea28bb82e0907a26fe370 (patch)
tree474b5109a00a0fa8275797b635a95431fe307cb5
parent30653175901204b40b051e510253f09d76b3555b (diff)
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 <ravishankar@redhat.com> Reviewed-on: http://review.gluster.org/12415 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
-rw-r--r--xlators/cluster/afr/src/afr-transaction.c6
1 files changed, 4 insertions, 2 deletions
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)