summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-read-txn.c
diff options
context:
space:
mode:
authorPoornima G <pgurusid@redhat.com>2016-11-21 11:49:35 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2016-11-28 20:10:24 -0800
commit570aefeb280e53e98cb5060cf384f1d74379a521 (patch)
tree4ca0d3f8f494347130e5568b0244a2cf716a99ed /xlators/cluster/afr/src/afr-read-txn.c
parent8943c19a2ef51b6e4fa66cb57211d469fe558579 (diff)
afr: Fix the EIO that can occur in afr_inode_refresh as a result
of cache invalidation(upcall). Issue: ------ When a cache invalidation is recieved as a result of changing pending xattr, the read_subvol is reset. Consider the below chain of execution: CHILD_DOWN ... afr_readv ... afr_inode_refresh ... afr_inode_read_subvol_reset <- as a result of pending xattr set by some other client GF_EVENT_UPCALL will be sent afr_refresh_done -> this results in an EIO, as the read subvol was reset by the end of the afr_inode_refresh Solution: --------- When GF_EVENT_UPCALL is recieved, instead of resetting read_subvol, set a variable need_refresh in inode_ctx, the next time some one starts a txn, along with event gen, need_rrefresh also needs to be checked. Change-Id: Ifda21a7a8039b8874215e1afa4bdf20f7d991b58 BUG: 1396952 Signed-off-by: Poornima G <pgurusid@redhat.com> Reviewed-on: http://review.gluster.org/15892 Reviewed-by: Ravishankar N <ravishankar@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-read-txn.c')
-rw-r--r--xlators/cluster/afr/src/afr-read-txn.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/xlators/cluster/afr/src/afr-read-txn.c b/xlators/cluster/afr/src/afr-read-txn.c
index 26b0f1c2a11..ffd14a98c8e 100644
--- a/xlators/cluster/afr/src/afr-read-txn.c
+++ b/xlators/cluster/afr/src/afr-read-txn.c
@@ -227,7 +227,8 @@ afr_read_txn (call_frame_t *frame, xlator_t *this, inode_t *inode,
gf_msg_debug (this->name, 0, "%s: generation now vs cached: %d, "
"%d", uuid_utoa (inode->gfid), local->event_generation,
event_generation);
- if (local->event_generation != event_generation)
+ if (afr_is_inode_refresh_reqd (inode, this, local->event_generation,
+ event_generation))
/* servers have disconnected / reconnected, and possibly
rebooted, very likely changing the state of freshness
of copies */