summaryrefslogtreecommitdiffstats
path: root/xlators/cluster
diff options
context:
space:
mode:
authorAnand Avati <avati@gluster.com>2010-02-22 09:23:13 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-02-22 07:13:08 -0800
commit2a78ca786da6233cce3ed9603676aa9ef293e3cf (patch)
treeaecef6fecce3c9125ddcc2971bc630a4cdafa87e /xlators/cluster
parent9dbae0c80569689533c92a29871e3fa6dbbae1b9 (diff)
dht: fix leak introduced in 137f94ed123b1c7c7ada541aaa599679e19888f6
dht_layout_t was getting leaked in dht_readdirp_cbk when dht_layout_get was called but was not unref'ed Signed-off-by: Anand V. Avati <avati@blackhole.gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 584 (automatically configure 'lookup-unhashed' option) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=584
Diffstat (limited to 'xlators/cluster')
-rw-r--r--xlators/cluster/dht/src/dht-common.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
index e6b23f783..fcdbe6a88 100644
--- a/xlators/cluster/dht/src/dht-common.c
+++ b/xlators/cluster/dht/src/dht-common.c
@@ -2120,7 +2120,10 @@ dht_readdirp_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int op_ret,
if (op_ret < 0)
goto done;
- layout = dht_layout_get (this, local->fd->inode);
+ if (!local->layout)
+ local->layout = layout = dht_layout_get (this, local->fd->inode);
+ else
+ layout = local->layout;
list_for_each_entry (orig_entry, (&orig_entries->list), list) {
next_offset = orig_entry->d_off;