From ae1201785ca7f14690d19c533bb8a7f5150ea29b Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Thu, 18 Jun 2009 15:58:22 +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 volume layer (mostly client-protocol). Signed-off-by: Anand V. Avati --- xlators/cluster/dht/src/dht-common.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'xlators') diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index 7c0c8f05..d367d26a 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