summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendra@redhat.com>2015-01-07 15:16:32 +0530
committerRaghavendra Bhat <raghavendra@redhat.com>2015-01-09 01:32:48 -0800
commit610d3cb22c6da822807dcf4fd1224d44f3f1f2e7 (patch)
treee76538de569e4fc924ca4b4a10e841ad70294f96
parent0664e74d86db2fd9a476241fdeacce840897d111 (diff)
avoid memory leaks in snapview-server
* snapview-server in readdirp, creates the inode for entries with names "." and ".." for each readdirp operation without creating dentries leading to memleak. It should have avoided creation of inodes for those entries > Change-Id: I3b2025fd10872fcc3303d0becec764ffd4e37601 > BUG: 1179663 > Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> > Reviewed-on: http://review.gluster.org/9404 > Tested-by: Gluster Build System <jenkins@build.gluster.com> > Reviewed-by: Vijay Bellur <vbellur@redhat.com> > Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Change-Id: Iea6c53c8db8b82189ef6c4a84dd3814349628ca3 BUG: 1180411 Reviewed-on: http://review.gluster.org/9426 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Sachin Pandit <spandit@redhat.com> Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
-rw-r--r--xlators/features/snapview-server/src/snapview-server.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/xlators/features/snapview-server/src/snapview-server.c b/xlators/features/snapview-server/src/snapview-server.c
index 040f444..4df7864 100644
--- a/xlators/features/snapview-server/src/snapview-server.c
+++ b/xlators/features/snapview-server/src/snapview-server.c
@@ -1335,6 +1335,9 @@ svs_readdirp_fill (xlator_t *this, inode_t *parent, svs_inode_t *parent_ctx,
GF_VALIDATE_OR_GOTO (this->name, parent_ctx, out);
GF_VALIDATE_OR_GOTO (this->name, entry, out);
+ if (!strcmp (entry->d_name, ".") || !strcmp (entry->d_name, ".."))
+ goto out;
+
inode = inode_grep (parent->table, parent, entry->d_name);
if (inode) {
entry->inode = inode;