From a6f0dca7cd348b2a428b2583ebcfc80425213d5c Mon Sep 17 00:00:00 2001 From: Anand Avati Date: Mon, 22 Feb 2010 09:23:13 +0000 Subject: 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 Signed-off-by: Anand V. Avati BUG: 584 (automatically configure 'lookup-unhashed' option) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=584 --- xlators/cluster/dht/src/dht-common.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index 8fcc3df35bd..14890965b50 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -2172,7 +2172,10 @@ dht_readdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this, 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; -- cgit