From 8a71e498fdcedacd1a32e121b3e081c61ee57a2e Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Mon, 16 May 2016 15:05:36 +0530 Subject: cluster/afr: Refresh inode for inode-write fops in need Problem: If a named fresh-lookup is done on an loc and the fop fails on one of the bricks or not sent on one of the bricks, but by the time response comes to afr, if the brick is up, 'can_interpret' will be set to false in afr_lookup_done(), this will lead to inode-ctx for that inode to be not set, this can lead to EIO in case of a transaction as it depends on 'readable' array to be available by that point. Fix: Refresh inode for inode-write fops for the ctx to be set if it is not already done at the time of named fresh-lookup or if the file is in split-brain where we need to perform one more refresh before failing the fop to check if the file is still in split-brain or not. BUG: 1336612 Change-Id: I5c50b62c8de06129b8516039f7c252e5008c47a5 Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.org/14368 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System Reviewed-by: Ravishankar N CentOS-regression: Gluster Build System --- xlators/cluster/afr/src/afr.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (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 f16f9b4b4ac..7d270ea94e7 100644 --- a/xlators/cluster/afr/src/afr.h +++ b/xlators/cluster/afr/src/afr.h @@ -422,6 +422,9 @@ typedef struct _afr_local { */ inode_t *refreshinode; + /*To handle setattr/setxattr on yet to be linked inode from dht*/ + uuid_t refreshgfid; + /* @pre_op_compat: @@ -855,7 +858,7 @@ afr_read_subvol_get (inode_t *inode, xlator_t *this, int *subvol_p, int afr_inode_refresh (call_frame_t *frame, xlator_t *this, inode_t *inode, - afr_inode_refresh_cbk_t cbk); + uuid_t gfid, afr_inode_refresh_cbk_t cbk); int32_t afr_notify (xlator_t *this, int32_t event, void *data, void *data2); -- cgit