summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/cluster/afr/src')
-rw-r--r--xlators/cluster/afr/src/afr-common.c7
-rw-r--r--xlators/cluster/afr/src/afr-transaction.c12
-rw-r--r--xlators/cluster/afr/src/afr.h7
3 files changed, 11 insertions, 15 deletions
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c
index 1c652f41e88..2ac0f078ffa 100644
--- a/xlators/cluster/afr/src/afr-common.c
+++ b/xlators/cluster/afr/src/afr-common.c
@@ -1204,7 +1204,6 @@ afr_local_transaction_cleanup (afr_local_t *local, xlator_t *this)
}
GF_FREE (local->transaction.eager_lock);
- GF_FREE (local->transaction.fop_subvols);
GF_FREE (local->transaction.failed_subvols);
GF_FREE (local->transaction.basename);
@@ -4176,12 +4175,6 @@ afr_transaction_local_init (afr_local_t *local, xlator_t *this)
goto out;
}
- local->transaction.fop_subvols = GF_CALLOC (sizeof (*local->transaction.fop_subvols),
- priv->child_count,
- gf_afr_mt_char);
- if (!local->transaction.fop_subvols)
- goto out;
-
local->transaction.failed_subvols = GF_CALLOC (sizeof (*local->transaction.failed_subvols),
priv->child_count,
gf_afr_mt_char);
diff --git a/xlators/cluster/afr/src/afr-transaction.c b/xlators/cluster/afr/src/afr-transaction.c
index 915b68ef07d..4c85a4b0d03 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);
@@ -59,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)
@@ -973,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)
diff --git a/xlators/cluster/afr/src/afr.h b/xlators/cluster/afr/src/afr.h
index 6a14febec0a..9ee5ae36df0 100644
--- a/xlators/cluster/afr/src/afr.h
+++ b/xlators/cluster/afr/src/afr.h
@@ -662,11 +662,8 @@ typedef struct _afr_local {
dict_t **pre_op_xdata;
unsigned char *pre_op_sources;
- /* @fop_subvols: subvolumes on which FOP will be attempted */
- unsigned char *fop_subvols;
-
- /* @failed_subvols: subvolumes on which FOP failed. Always
- a subset of @fop_subvols */
+ /* @failed_subvols: subvolumes on which a pre-op or a
+ FOP failed. */
unsigned char *failed_subvols;
/* @dirtied: flag which indicates whether we set dirty flag