summaryrefslogtreecommitdiffstats
path: root/xlators/cluster
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/cluster')
-rw-r--r--xlators/cluster/afr/src/afr-common.c2
-rw-r--r--xlators/cluster/afr/src/afr-read-txn.c1
-rw-r--r--xlators/cluster/afr/src/afr.h2
3 files changed, 4 insertions, 1 deletions
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c
index 57745c323e4..e151c01eb0d 100644
--- a/xlators/cluster/afr/src/afr-common.c
+++ b/xlators/cluster/afr/src/afr-common.c
@@ -1103,7 +1103,7 @@ afr_txn_refresh_done (call_frame_t *frame, xlator_t *this, int err)
&event_generation,
local->transaction.type);
- if (ret == -EIO || !event_generation) {
+ if (ret == -EIO || (local->is_read_txn && !event_generation)) {
/* No readable subvolume even after refresh ==> splitbrain.*/
if (!priv->fav_child_policy) {
err = -EIO;
diff --git a/xlators/cluster/afr/src/afr-read-txn.c b/xlators/cluster/afr/src/afr-read-txn.c
index ffd14a98c8e..deb74445a55 100644
--- a/xlators/cluster/afr/src/afr-read-txn.c
+++ b/xlators/cluster/afr/src/afr-read-txn.c
@@ -201,6 +201,7 @@ afr_read_txn (call_frame_t *frame, xlator_t *this, inode_t *inode,
local->readfn = readfn;
local->inode = inode_ref (inode);
+ local->is_read_txn = _gf_true;
if (priv->quorum_reads &&
priv->quorum_count && !afr_has_quorum (priv->child_up, this)) {
diff --git a/xlators/cluster/afr/src/afr.h b/xlators/cluster/afr/src/afr.h
index eaad64a4f40..642d633f9c4 100644
--- a/xlators/cluster/afr/src/afr.h
+++ b/xlators/cluster/afr/src/afr.h
@@ -806,6 +806,8 @@ typedef struct _afr_local {
gf_boolean_t compound;
afr_fop_lock_state_t fop_lock_state;
compound_args_t *c_args;
+
+ gf_boolean_t is_read_txn;
} afr_local_t;