summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaghavendra G <rgowdapp@redhat.com>2016-06-16 12:03:19 +0530
committerRaghavendra G <rgowdapp@redhat.com>2016-08-10 01:40:19 -0700
commita9e14f31bbd3a6f48b1974744a611b834a22a11e (patch)
tree6f0effcf174212792a02b4e114ff0ada1ec65693
parent547b0b8256994e9ca3eda1e1f776cabbbc51f273 (diff)
storage/posix: fix inode leaks
> Reviewed-on: http://review.gluster.org/14739 > Smoke: Gluster Build System <jenkins@build.gluster.org> > CentOS-regression: Gluster Build System <jenkins@build.gluster.org> > NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> > Reviewed-by: N Balachandran <nbalacha@redhat.com> > Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> > Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com> BUG: 1364886 Change-Id: Ibd221ba62af4db17bea5c52d37f5c0ba30b60a7d Signed-off-by: Raghavendra G <rgowdapp@redhat.com> Signed-off-by: Oleksandr Natalenko <oleksandr@natalenko.name> Reviewed-on: http://review.gluster.org/15107 Reviewed-by: N Balachandran <nbalacha@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Prashanth Pai <ppai@redhat.com> Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
-rw-r--r--xlators/storage/posix/src/posix-handle.c2
-rw-r--r--xlators/storage/posix/src/posix.c5
2 files changed, 6 insertions, 1 deletions
diff --git a/xlators/storage/posix/src/posix-handle.c b/xlators/storage/posix/src/posix-handle.c
index d9086530322..9629d835dc0 100644
--- a/xlators/storage/posix/src/posix-handle.c
+++ b/xlators/storage/posix/src/posix-handle.c
@@ -984,6 +984,8 @@ posix_create_link_if_gfid_exists (xlator_t *this, uuid_t gfid, char *real_path,
}
unlock:
UNLOCK (&inode->lock);
+
+ inode_unref (inode);
}
return ret;
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c
index ec1793e37a0..ab2dcc2905b 100644
--- a/xlators/storage/posix/src/posix.c
+++ b/xlators/storage/posix/src/posix.c
@@ -6131,8 +6131,11 @@ posix_readdirp_fill (xlator_t *this, fd_t *fd, gf_dirent_t *entries, dict_t *dic
ret = posix_pstat (this, gfid, hpath, &stbuf);
- if (ret == -1)
+ if (ret == -1) {
+ if (inode)
+ inode_unref (inode);
continue;
+ }
if (!inode)
inode = inode_find (itable, stbuf.ia_gfid);