From 570aefeb280e53e98cb5060cf384f1d74379a521 Mon Sep 17 00:00:00 2001 From: Poornima G Date: Mon, 21 Nov 2016 11:49:35 +0530 Subject: 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 Reviewed-on: http://review.gluster.org/15892 Reviewed-by: Ravishankar N Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Pranith Kumar Karampuri --- xlators/cluster/afr/src/afr.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'xlators/cluster/afr/src/afr.h') diff --git a/xlators/cluster/afr/src/afr.h b/xlators/cluster/afr/src/afr.h index 9bfb5812d8a..dcc162f97c3 100644 --- a/xlators/cluster/afr/src/afr.h +++ b/xlators/cluster/afr/src/afr.h @@ -812,6 +812,7 @@ typedef struct _afr_inode_ctx { uint64_t read_subvol; int spb_choice; gf_timer_t *timer; + gf_boolean_t need_refresh; } afr_inode_ctx_t; typedef struct afr_spbc_timeout { @@ -1235,4 +1236,8 @@ __afr_fd_ctx_get (fd_t *fd, xlator_t *this); void afr_compound_cleanup (compound_args_t *args, dict_t *xdata, dict_t *newloc_xdata); + +gf_boolean_t +afr_is_inode_refresh_reqd (inode_t *inode, xlator_t *this, + int event_gen1, int event_gen2); #endif /* __AFR_H__ */ -- cgit