From b9d94056e555c2386cee3344db23518a47970a97 Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Thu, 27 Oct 2011 23:13:43 +0530 Subject: check the return value of inode_path for less than or equal to zero Change-Id: I9bbdfe79664c1339b66819a6c7ea4b7698beb5c6 BUG: 3757 Reviewed-on: http://review.gluster.com/640 Tested-by: Gluster Build System Reviewed-by: Amar Tumballi --- xlators/cluster/stripe/src/stripe.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'xlators/cluster') diff --git a/xlators/cluster/stripe/src/stripe.c b/xlators/cluster/stripe/src/stripe.c index a5decb01037..d47acd6b3ae 100644 --- a/xlators/cluster/stripe/src/stripe.c +++ b/xlators/cluster/stripe/src/stripe.c @@ -4166,12 +4166,13 @@ unlock: loc.ino = inode->ino = local_entry->d_ino; loc.inode = inode; loc.parent = local->fd->inode; + uuid_copy (loc.gfid, local_entry->d_stat.ia_gfid); ret = inode_path (local->fd->inode, local_entry->d_name, &path); - if (ret != -1) { + if (ret > 0) { loc.path = path; } else if (inode) { ret = inode_path (inode, NULL, &path); - if (ret != -1) { + if (ret > 0) { loc.path = path; } else { goto out; @@ -4249,8 +4250,10 @@ stripe_readdirp (call_frame_t *frame, xlator_t *this, local->op_ret = -1; INIT_LIST_HEAD(&local->entries); - if (!trav) + if (!trav) { + gf_log (this->name, GF_LOG_ERROR, "this->children is NULL"); goto err; + } STACK_WIND (frame, stripe_readdirp_cbk, trav->xlator, trav->xlator->fops->readdirp, fd, size, off); -- cgit