diff options
author | Raghavendra Bhat <raghavendra@redhat.com> | 2012-11-29 21:43:23 +0530 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2012-12-04 12:14:28 -0800 |
commit | 48a1738467c2328a9f8d0fce09b64f286ef533e0 (patch) | |
tree | 64841950835fe99e9c464f434ff72f30f38ef9f2 /xlators | |
parent | 01217e4e16677b13c7febc66e4e4ca3f0025739b (diff) |
fix memory leaks
* write-behind: free the inode context in wb_forget
* distribute: in readdirp callback put the allocated context to the inode
* distribute: check if the layout is NULL before accessing it in layout_unref
Change-Id: I7698f81b85b99d06bf6b01fc1a6e51e1593b5e27
BUG: 790709
Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
Reviewed-on: http://review.gluster.org/4250
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/cluster/dht/src/dht-helper.c | 2 | ||||
-rw-r--r-- | xlators/cluster/dht/src/dht-layout.c | 2 | ||||
-rw-r--r-- | xlators/performance/write-behind/src/write-behind.c | 2 |
3 files changed, 5 insertions, 1 deletions
diff --git a/xlators/cluster/dht/src/dht-helper.c b/xlators/cluster/dht/src/dht-helper.c index 055ea7cb..264172a9 100644 --- a/xlators/cluster/dht/src/dht-helper.c +++ b/xlators/cluster/dht/src/dht-helper.c @@ -948,6 +948,8 @@ dht_inode_ctx_time_update (inode_t *inode, xlator_t *this, struct iatt *stat, DHT_UPDATE_TIME(time->atime, time->atime_nsec, stat->ia_atime, stat->ia_atime_nsec, inode, post); + ret = dht_inode_ctx_set (inode, this, ctx); + return 0; } diff --git a/xlators/cluster/dht/src/dht-layout.c b/xlators/cluster/dht/src/dht-layout.c index da0e449f..ef728209 100644 --- a/xlators/cluster/dht/src/dht-layout.c +++ b/xlators/cluster/dht/src/dht-layout.c @@ -114,7 +114,7 @@ dht_layout_unref (xlator_t *this, dht_layout_t *layout) dht_conf_t *conf = NULL; int ref = 0; - if (layout->preset || !this->private) + if (!layout || layout->preset || !this->private) return; conf = this->private; diff --git a/xlators/performance/write-behind/src/write-behind.c b/xlators/performance/write-behind/src/write-behind.c index ffa333ce..232e6c0d 100644 --- a/xlators/performance/write-behind/src/write-behind.c +++ b/xlators/performance/write-behind/src/write-behind.c @@ -1650,6 +1650,8 @@ wb_forget (xlator_t *this, inode_t *inode) } UNLOCK (&wb_inode->lock); + GF_FREE (wb_inode); + return 0; } |