From bb2df4e63fa8a5d65f18b4a5efc757e8d475fbff Mon Sep 17 00:00:00 2001 From: Krutika Dhananjay Date: Thu, 22 Jan 2015 17:02:20 +0530 Subject: cluster/afr: When parent and entry read subvols are different, set entry->inode to NULL Backport of: http://review.gluster.org/#/c/9477 That way a lookup would be forced on the entry, and its attributes will always be selected from its read subvol. Additionally, directory write fops as well as LOOKUP have been made to unwind parent attributes from parent's read child in AFR. Change-Id: I9fca49fa91cc3a65f53db855fedb90b08f1ca7f4 BUG: 1186121 Signed-off-by: Krutika Dhananjay Reviewed-on: http://review.gluster.org/9504 Tested-by: Gluster Build System Reviewed-by: Pranith Kumar Karampuri Tested-by: Pranith Kumar Karampuri --- xlators/cluster/afr/src/afr.h | 19 +++++++++++++++++++ 1 file changed, 19 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 87ad67c6384..2548900127f 100644 --- a/xlators/cluster/afr/src/afr.h +++ b/xlators/cluster/afr/src/afr.h @@ -1195,6 +1195,25 @@ afr_xattr_array_destroy (dict_t **xattr, unsigned int child_count); } \ } while (0) +#define AFR_UPDATE_PARENT_BUF(parent, this, child_index, local, \ + dst_preparent, dst_postparent, \ + src_preparent, src_postparent) do { \ + int __par_read_child = -1; \ + if (parent) { \ + __par_read_child = afr_inode_get_read_ctx (this, parent, \ + NULL); \ + if (__par_read_child < 0) \ + __par_read_child = local->read_child_index; \ + if ((local->success_count == 0) || \ + (__par_read_child == child_index)) { \ + if (src_preparent) \ + dst_preparent = *src_preparent; \ + if (src_postparent) \ + dst_postparent = *src_postparent; \ + } \ + } \ +} while (0) + int afr_fd_report_unstable_write (xlator_t *this, fd_t *fd); -- cgit