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.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'xlators/cluster/afr/src/afr.c') 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, -- cgit