diff options
author | Amar Tumballi <amar@gluster.com> | 2009-06-18 16:14:02 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2009-06-18 15:54:14 -0700 |
commit | d1a544fe60e0b72194635db927032e309c79c255 (patch) | |
tree | e2e7fccf883e76c59689480ff0dc14ed9f5201eb /xlators | |
parent | d3da0151cb636b82a0ef1644b80c7f72ec6ccf0c (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 client-protocol layer.
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
Diffstat (limited to 'xlators')
-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 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; |