diff options
author | Amar Tumballi <amar@gluster.com> | 2009-06-18 15:58:22 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2009-06-18 15:54:13 -0700 |
commit | ae1201785ca7f14690d19c533bb8a7f5150ea29b (patch) | |
tree | 697c16e3fd8a62caaea31965c605c7ebe059888a /xlators/cluster/dht | |
parent | 93c8ce0e3fc295087775185c0f8594f06244098d (diff) |
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 <avati@dev.gluster.com>
Diffstat (limited to 'xlators/cluster/dht')
-rw-r--r-- | xlators/cluster/dht/src/dht-common.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index 7c0c8f058..d367d26a2 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; |