From 84c3d7a83a8c84ca11514202a1bc365026fd1c87 Mon Sep 17 00:00:00 2001 From: Pranith K Date: Thu, 14 Jul 2011 06:30:40 +0000 Subject: cluster/afr: Detect conflict/gfid self-heals Added some helper functions that can be reused Signed-off-by: Pranith Kumar K Signed-off-by: Anand Avati BUG: 2745 (failure to detect split brain) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2745 --- xlators/cluster/afr/src/afr-self-heal-common.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'xlators/cluster/afr/src/afr-self-heal-common.c') diff --git a/xlators/cluster/afr/src/afr-self-heal-common.c b/xlators/cluster/afr/src/afr-self-heal-common.c index 16345bee738..b28f9114fc0 100644 --- a/xlators/cluster/afr/src/afr-self-heal-common.c +++ b/xlators/cluster/afr/src/afr-self-heal-common.c @@ -1663,7 +1663,7 @@ afr_self_heal_completion_cbk (call_frame_t *bgsh_frame, xlator_t *this) FRAME_SU_UNDO (bgsh_frame, afr_local_t); if (!sh->unwound) { - sh->unwind (sh->orig_frame, this); + sh->unwind (sh->orig_frame, this, sh->op_ret, sh->op_errno); } if (sh->background) { @@ -1723,7 +1723,8 @@ afr_self_heal (call_frame_t *frame, xlator_t *this, inode_t *inode) sh_local = afr_local_copy (local, this); sh_frame->local = sh_local; sh = &sh_local->self_heal; - sh->inode = inode; + + sh->inode = inode_ref (inode); sh->orig_frame = frame; @@ -1731,6 +1732,8 @@ afr_self_heal (call_frame_t *frame, xlator_t *this, inode_t *inode) sh->buf = GF_CALLOC (priv->child_count, sizeof (struct iatt), gf_afr_mt_iatt); + sh->parentbufs = GF_CALLOC (priv->child_count, sizeof (struct iatt), + gf_afr_mt_iatt); sh->child_errno = GF_CALLOC (priv->child_count, sizeof (int), gf_afr_mt_int); sh->success = GF_CALLOC (priv->child_count, sizeof (int), -- cgit