From 985f87517b7d00afd626f2cc85ca2ab02d33e613 Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Fri, 7 Jan 2011 00:45:48 +0000 Subject: cluster/replicate: update st_nlink count of stat sent to application after completion of entry-self-heal. - certain applications like 'find' use st_nlink count to optimize searches. Hence an incorrect hard link count can result in non-healing of some of the newly created subdirectories. Signed-off-by: Raghavendra G Signed-off-by: Anand V. Avati BUG: 2187 (Self heal errors) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2187 --- xlators/cluster/afr/src/afr-self-heal-entry.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'xlators') diff --git a/xlators/cluster/afr/src/afr-self-heal-entry.c b/xlators/cluster/afr/src/afr-self-heal-entry.c index 2010ae648f5..dff64610d16 100644 --- a/xlators/cluster/afr/src/afr-self-heal-entry.c +++ b/xlators/cluster/afr/src/afr-self-heal-entry.c @@ -122,12 +122,27 @@ afr_sh_entry_erase_pending_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, dict_t *xattr) { - int call_count = 0; + int call_count = 0; + afr_local_t *local = NULL; + afr_self_heal_t *sh = NULL; + afr_local_t *orig_local = NULL; + call_frame_t *orig_frame = NULL; call_count = afr_frame_return (frame); - if (call_count == 0) - afr_sh_entry_finish (frame, this); + if (call_count == 0) { + local = frame->local; + sh = &local->self_heal; + + orig_frame = sh->orig_frame; + orig_local = orig_frame->local; + + if (sh->source != -1) { + orig_local->cont.lookup.buf.ia_nlink = sh->buf[sh->source].ia_nlink; + } + + afr_sh_entry_finish (frame, this); + } return 0; } -- cgit