From 3fe840d93730f1f7feef053e58dfbc40f99cae04 Mon Sep 17 00:00:00 2001 From: Vikas Gorur Date: Tue, 24 Nov 2009 07:41:36 +0000 Subject: cluster/afr: Fix inode context bitmasks. Set opendir_done and split_brain flags correctly in the inode context. Signed-off-by: Vikas Gorur Signed-off-by: Anand V. Avati BUG: 249 (Self heal of a file that does not exist on the first subvolume) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=249 --- xlators/cluster/afr/src/afr-dir-read.c | 4 ++-- xlators/cluster/afr/src/afr-self-heal-common.c | 8 ++------ xlators/cluster/afr/src/afr.c | 12 +++++------- xlators/cluster/afr/src/afr.h | 4 ++-- 4 files changed, 11 insertions(+), 17 deletions(-) (limited to 'xlators/cluster') diff --git a/xlators/cluster/afr/src/afr-dir-read.c b/xlators/cluster/afr/src/afr-dir-read.c index ac0663ad9..ed052589c 100644 --- a/xlators/cluster/afr/src/afr-dir-read.c +++ b/xlators/cluster/afr/src/afr-dir-read.c @@ -57,7 +57,7 @@ afr_examine_dir_completion_cbk (call_frame_t *frame, xlator_t *this) local = frame->local; sh = &local->self_heal; - afr_set_opendir_done (this, local->fd->inode, 1); + afr_set_opendir_done (this, local->fd->inode); /* let self-heal's local cleanup free this */ local->cont.opendir.checksum = NULL; @@ -167,7 +167,7 @@ out: afr_self_heal (frame, this, afr_examine_dir_completion_cbk); } else { - afr_set_opendir_done (this, local->fd->inode, 1); + afr_set_opendir_done (this, local->fd->inode); AFR_STACK_UNWIND (opendir, frame, local->op_ret, local->op_errno, local->fd); diff --git a/xlators/cluster/afr/src/afr-self-heal-common.c b/xlators/cluster/afr/src/afr-self-heal-common.c index 8142bdf1d..a60331d51 100644 --- a/xlators/cluster/afr/src/afr-self-heal-common.c +++ b/xlators/cluster/afr/src/afr-self-heal-common.c @@ -1405,9 +1405,7 @@ afr_bgsh_completion_cbk (call_frame_t *bgsh_frame, xlator_t *this) sh = &local->self_heal; if (local->govinda_gOvinda) { - afr_set_split_brain (this, local->cont.lookup.inode, 1); - } else { - afr_set_split_brain (this, local->cont.lookup.inode, 0); + afr_set_split_brain (this, local->cont.lookup.inode); } gf_log (this->name, GF_LOG_TRACE, @@ -1444,9 +1442,7 @@ afr_bgsh_unwind (call_frame_t *bgsh_frame, xlator_t *this) sh = &local->self_heal; if (local->govinda_gOvinda) { - afr_set_split_brain (this, local->cont.lookup.inode, 1); - } else { - afr_set_split_brain (this, local->cont.lookup.inode, 0); + afr_set_split_brain (this, local->cont.lookup.inode); } gf_log (this->name, GF_LOG_TRACE, diff --git a/xlators/cluster/afr/src/afr.c b/xlators/cluster/afr/src/afr.c index 3f1928157..d6c1d8bcf 100644 --- a/xlators/cluster/afr/src/afr.c +++ b/xlators/cluster/afr/src/afr.c @@ -88,7 +88,7 @@ out: void -afr_set_split_brain (xlator_t *this, inode_t *inode, int32_t split_brain) +afr_set_split_brain (xlator_t *this, inode_t *inode) { uint64_t ctx = 0; int ret = 0; @@ -104,7 +104,7 @@ afr_set_split_brain (xlator_t *this, inode_t *inode, int32_t split_brain) } ctx = (~AFR_ICTX_SPLIT_BRAIN_MASK & ctx) - | (split_brain & AFR_ICTX_SPLIT_BRAIN_MASK); + | (0xFFFFFFFFFFFFFFFFULL & AFR_ICTX_SPLIT_BRAIN_MASK); __inode_ctx_put (inode, this, ctx); } @@ -142,7 +142,7 @@ out: void -afr_set_opendir_done (xlator_t *this, inode_t *inode, int32_t opendir_done) +afr_set_opendir_done (xlator_t *this, inode_t *inode) { uint64_t ctx = 0; int ret = 0; @@ -158,7 +158,7 @@ afr_set_opendir_done (xlator_t *this, inode_t *inode, int32_t opendir_done) } ctx = (~AFR_ICTX_OPENDIR_DONE_MASK & ctx) - | (opendir_done & AFR_ICTX_OPENDIR_DONE_MASK); + | (0xFFFFFFFFFFFFFFFFULL & AFR_ICTX_OPENDIR_DONE_MASK); __inode_ctx_put (inode, this, ctx); } @@ -474,9 +474,7 @@ afr_self_heal_cbk (call_frame_t *frame, xlator_t *this) local = frame->local; if (local->govinda_gOvinda) { - afr_set_split_brain (this, local->cont.lookup.inode, 1); - } else { - afr_set_split_brain (this, local->cont.lookup.inode, 0); + afr_set_split_brain (this, local->cont.lookup.inode); } AFR_STACK_UNWIND (lookup, frame, local->op_ret, local->op_errno, diff --git a/xlators/cluster/afr/src/afr.h b/xlators/cluster/afr/src/afr.h index 2d497afe1..3bd8a458b 100644 --- a/xlators/cluster/afr/src/afr.h +++ b/xlators/cluster/afr/src/afr.h @@ -551,10 +551,10 @@ int afr_frame_return (call_frame_t *frame); void -afr_set_split_brain (xlator_t *this, inode_t *inode, int32_t split_brain); +afr_set_split_brain (xlator_t *this, inode_t *inode); void -afr_set_opendir_done (xlator_t *this, inode_t *inode, int32_t opendir_done); +afr_set_opendir_done (xlator_t *this, inode_t *inode); uint64_t afr_is_opendir_done (xlator_t *this, inode_t *inode); -- cgit