From f5137bf755542f4ea28d4fce3c659c1b9ec38647 Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Fri, 13 Aug 2010 08:15:31 +0000 Subject: fixes for spurious entry self-heal in afr Signed-off-by: Pranith Kumar K Signed-off-by: Anand V. Avati BUG: 974 (Spurious self-heal?) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=974 --- xlators/storage/posix/src/posix.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'xlators/storage/posix') diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c index 0b7ab190c33..1d3b179f61e 100644 --- a/xlators/storage/posix/src/posix.c +++ b/xlators/storage/posix/src/posix.c @@ -4392,6 +4392,7 @@ posix_do_readdir (call_frame_t *frame, xlator_t *this, int entry_path_len = -1; struct posix_private *priv = NULL; struct stat stbuf = {0, }; + char base_path[PATH_MAX] = {0,}; VALIDATE_OR_GOTO (frame, out); VALIDATE_OR_GOTO (this, out); @@ -4423,6 +4424,9 @@ posix_do_readdir (call_frame_t *frame, xlator_t *this, entry_path_len = real_path_len + NAME_MAX; entry_path = alloca (entry_path_len); + strncpy(base_path, POSIX_BASE_PATH(this), sizeof(base_path)); + base_path[strlen(base_path)] = '/'; + if (!entry_path) { op_errno = errno; gf_log (this->name, GF_LOG_ERROR, @@ -4474,6 +4478,10 @@ posix_do_readdir (call_frame_t *frame, xlator_t *this, break; } + if ((!strcmp(real_path, base_path)) + && (!strcmp(entry->d_name, GF_REPLICATE_TRASH_DIR))) + continue; + this_size = dirent_size (entry); if (this_size + filled > size) { -- cgit