From d1a544fe60e0b72194635db927032e309c79c255 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Thu, 18 Jun 2009 16:14:02 +0000 Subject: local->loc should be filled in dht-mknod() local->loc should be properly filled while creating a linkfile. otherwise this causes the segfault in underlying client-protocol layer. Signed-off-by: Anand V. Avati --- xlators/cluster/dht/src/dht-common.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index 7c0c8f0581a..d367d26a293 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -2373,6 +2373,7 @@ dht_mknod (call_frame_t *frame, xlator_t *this, { xlator_t *subvol = NULL; int op_errno = -1; + int ret = -1; xlator_t *avail_subvol = NULL; dht_conf_t *conf = NULL; dht_local_t *local = NULL; @@ -2413,6 +2414,14 @@ dht_mknod (call_frame_t *frame, xlator_t *this, "Out of memory"); goto err; } + ret = loc_dup (loc, &local->loc); + if (ret == -1) { + op_errno = ENOMEM; + gf_log (this->name, GF_LOG_ERROR, + "Out of memory"); + goto err; + } + local->cached_subvol = avail_subvol; local->mode = mode; local->rdev = rdev; -- cgit