summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr
diff options
context:
space:
mode:
authorAshish Pandey <aspandey@redhat.com>2019-03-08 10:42:12 +0530
committerAshish Pandey <aspandey@redhat.com>2019-05-13 05:36:51 +0000
commita1fa0379b7ae059a9fbce737cd477407ab082c05 (patch)
tree674e972d761585036b6f46dd8484b21f5d4b1e7f /xlators/cluster/afr
parentab296b5be79ac2859072fd89cda32715f2ac57a5 (diff)
cluster/afr : TA: Return actual error code in case of failure
In afr_ta_post_op_do, we were sending EIO for every failure. However, the original error code should be sent. Change-Id: I9fdc15dac00d758baf8e6f14db244f526481a63a updates: bz#1709143 Signed-off-by: Ashish Pandey <aspandey@redhat.com> (cherry picked from commit 63159cdb5374f458d7d2bffec24d4720ffc96d6c)
Diffstat (limited to 'xlators/cluster/afr')
-rw-r--r--xlators/cluster/afr/src/afr-transaction.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/xlators/cluster/afr/src/afr-transaction.c b/xlators/cluster/afr/src/afr-transaction.c
index 15f3a7efa91..4a34d838596 100644
--- a/xlators/cluster/afr/src/afr-transaction.c
+++ b/xlators/cluster/afr/src/afr-transaction.c
@@ -32,7 +32,7 @@ static void
afr_post_op_handle_success(call_frame_t *frame, xlator_t *this);
static void
-afr_post_op_handle_failure(call_frame_t *frame, xlator_t *this);
+afr_post_op_handle_failure(call_frame_t *frame, xlator_t *this, int op_errno);
void
__afr_transaction_wake_shared(afr_local_t *local, struct list_head *shared);
@@ -745,7 +745,7 @@ afr_ta_process_onwireq(afr_local_t *local, xlator_t *this)
if (entry->ta_failed_subvol == bad_child) {
afr_post_op_handle_success(entry->transaction.frame, this);
} else {
- afr_post_op_handle_failure(entry->transaction.frame, this);
+ afr_post_op_handle_failure(entry->transaction.frame, this, EIO);
}
}
}
@@ -1300,7 +1300,7 @@ out:
/*Mark pending xattrs on the up data brick.*/
afr_post_op_handle_success(local->transaction.frame, this);
} else {
- afr_post_op_handle_failure(local->transaction.frame, this);
+ afr_post_op_handle_failure(local->transaction.frame, this, -ret);
}
return ret;
}
@@ -1393,9 +1393,9 @@ afr_post_op_handle_success(call_frame_t *frame, xlator_t *this)
}
static void
-afr_post_op_handle_failure(call_frame_t *frame, xlator_t *this)
+afr_post_op_handle_failure(call_frame_t *frame, xlator_t *this, int op_errno)
{
- afr_changelog_post_op_fail(frame, this, EIO);
+ afr_changelog_post_op_fail(frame, this, op_errno);
return;
}
@@ -1425,7 +1425,7 @@ afr_ta_decide_post_op_state(call_frame_t *frame, xlator_t *this)
afr_post_op_handle_success(frame, this);
break;
case TA_INFO_IN_MEMORY_FAILED:
- afr_post_op_handle_failure(frame, this);
+ afr_post_op_handle_failure(frame, this, EIO);
break;
default:
break;