diff options
author | Raghavendra G <raghavendra@gluster.com> | 2011-01-07 00:45:48 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2011-01-07 17:58:44 -0800 |
commit | 985f87517b7d00afd626f2cc85ca2ab02d33e613 (patch) | |
tree | 0b8a9cf1bdc02224146b3ed22d7efc1a705417aa /xlators | |
parent | 38d0824031f445620fa0d704043cd5dedadea721 (diff) |
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 <raghavendra@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 2187 (Self heal errors)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2187
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/cluster/afr/src/afr-self-heal-entry.c | 21 |
1 files changed, 18 insertions, 3 deletions
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; } |