summaryrefslogtreecommitdiffstats
path: root/xlators/storage
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/storage')
-rw-r--r--xlators/storage/posix/src/posix.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c
index da5156709d1..7372596e744 100644
--- a/xlators/storage/posix/src/posix.c
+++ b/xlators/storage/posix/src/posix.c
@@ -3948,6 +3948,7 @@ posix_do_readdir (call_frame_t *frame, xlator_t *this,
int entry_path_len = -1;
struct posix_private *priv = NULL;
struct iatt stbuf = {0, };
+ char base_path[PATH_MAX] = {0,};
VALIDATE_OR_GOTO (frame, out);
VALIDATE_OR_GOTO (this, out);
@@ -3979,6 +3980,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,
@@ -4030,6 +4034,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) {