summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht
diff options
context:
space:
mode:
authorAnand V. Avati <avati@blackhole.gluster.com>2009-10-16 07:30:24 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-10-16 06:22:14 -0700
commitff38298144730c95627cfc11416baa6b75d3c94d (patch)
tree19373afaef496aa7e7c36eb901a8c6fff11dea18 /xlators/cluster/dht
parentcb76cadb74a36e220a2b6a886c0c8068abdad0c7 (diff)
distribute - more NULL check
Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 315 (generation number support) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=315
Diffstat (limited to 'xlators/cluster/dht')
-rw-r--r--xlators/cluster/dht/src/dht-common.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
index 62b864ac9ff..959e96ee9da 100644
--- a/xlators/cluster/dht/src/dht-common.c
+++ b/xlators/cluster/dht/src/dht-common.c
@@ -701,7 +701,8 @@ dht_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
dht_itransform (this, prev->this, stbuf->st_ino,
&stbuf->st_ino);
- postparent->st_ino = loc->parent->ino;
+ if (loc->parent)
+ postparent->st_ino = loc->parent->ino;
ret = dht_layout_preset (this, prev->this, inode);
if (ret < 0) {
@@ -2426,6 +2427,14 @@ dht_mknod (call_frame_t *frame, xlator_t *this,
dht_get_du_info (frame, this, loc);
+ local = dht_local_init (frame);
+ if (!local) {
+ op_errno = ENOMEM;
+ gf_log (this->name, GF_LOG_ERROR,
+ "Out of memory");
+ goto err;
+ }
+
subvol = dht_subvol_get_hashed (this, loc);
if (!subvol) {
gf_log (this->name, GF_LOG_DEBUG,
@@ -2488,14 +2497,23 @@ int
dht_symlink (call_frame_t *frame, xlator_t *this,
const char *linkname, loc_t *loc)
{
- xlator_t *subvol = NULL;
- int op_errno = -1;
+ xlator_t *subvol = NULL;
+ int op_errno = -1;
+ dht_local_t *local = NULL;
VALIDATE_OR_GOTO (frame, err);
VALIDATE_OR_GOTO (this, err);
VALIDATE_OR_GOTO (loc, err);
+ local = dht_local_init (frame);
+ if (!local) {
+ op_errno = ENOMEM;
+ gf_log (this->name, GF_LOG_ERROR,
+ "Out of memory");
+ goto err;
+ }
+
subvol = dht_subvol_get_hashed (this, loc);
if (!subvol) {
gf_log (this->name, GF_LOG_DEBUG,