summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendrabhat@gluster.com>2011-10-27 23:13:43 +0530
committerVijay Bellur <vijay@gluster.com>2011-10-28 04:14:56 -0700
commitb9d94056e555c2386cee3344db23518a47970a97 (patch)
tree09013709517fd550301c1847db2181324ad0ac63 /xlators
parent3b0eecb53f3a061016d277f862d54e15d2646bd6 (diff)
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 <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amar@gluster.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/cluster/stripe/src/stripe.c9
-rw-r--r--xlators/features/locks/src/inodelk.c4
-rw-r--r--xlators/features/marker/src/marker-quota-helper.c2
-rw-r--r--xlators/features/marker/src/marker.c2
-rw-r--r--xlators/features/quota/src/quota.c4
-rw-r--r--xlators/nfs/server/src/nfs-common.c6
-rw-r--r--xlators/protocol/client/src/client-handshake.c4
7 files changed, 17 insertions, 14 deletions
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);
diff --git a/xlators/features/locks/src/inodelk.c b/xlators/features/locks/src/inodelk.c
index 6fa9f399763..a122d54eba5 100644
--- a/xlators/features/locks/src/inodelk.c
+++ b/xlators/features/locks/src/inodelk.c
@@ -392,7 +392,7 @@ release_inode_locks_of_transport (xlator_t *this, pl_dom_list_t *dom,
list_del_init (&l->blocked_locks);
- if (inode_path (inode, NULL, &path) < 0) {
+ if (inode_path (inode, NULL, &path) <= 0) {
gf_log (this->name, GF_LOG_TRACE,
"inode_path failed");
goto unlock;
@@ -420,7 +420,7 @@ release_inode_locks_of_transport (xlator_t *this, pl_dom_list_t *dom,
__destroy_inode_lock (l);
- if (inode_path (inode, NULL, &path) < 0) {
+ if (inode_path (inode, NULL, &path) <= 0) {
gf_log (this->name, GF_LOG_TRACE,
"inode_path failed");
goto unlock;
diff --git a/xlators/features/marker/src/marker-quota-helper.c b/xlators/features/marker/src/marker-quota-helper.c
index 10746254ded..0295b489e7d 100644
--- a/xlators/features/marker/src/marker-quota-helper.c
+++ b/xlators/features/marker/src/marker-quota-helper.c
@@ -94,7 +94,7 @@ mq_inode_loc_fill (const char *parent_gfid, inode_t *inode, loc_t *loc)
ignore_parent:
ret = inode_path (inode, NULL, &resolvedpath);
- if (ret < 0)
+ if (ret <= 0)
goto err;
ret = mq_loc_fill (loc, inode, parent, resolvedpath);
diff --git a/xlators/features/marker/src/marker.c b/xlators/features/marker/src/marker.c
index 050da8879ee..f597309e412 100644
--- a/xlators/features/marker/src/marker.c
+++ b/xlators/features/marker/src/marker.c
@@ -113,7 +113,7 @@ marker_inode_loc_fill (inode_t *inode, loc_t *loc)
ignore_parent:
ret = inode_path (inode, NULL, &resolvedpath);
- if (ret < 0)
+ if (ret <= 0)
goto err;
ret = marker_loc_fill (loc, inode, parent, resolvedpath);
diff --git a/xlators/features/quota/src/quota.c b/xlators/features/quota/src/quota.c
index bfadba8cfda..3b6cfb62ccb 100644
--- a/xlators/features/quota/src/quota.c
+++ b/xlators/features/quota/src/quota.c
@@ -96,7 +96,7 @@ quota_inode_loc_fill (inode_t *inode, loc_t *loc)
ignore_parent:
ret = inode_path (inode, NULL, &resolvedpath);
- if (ret < 0) {
+ if (ret <= 0) {
gf_log (this->name, GF_LOG_WARNING,
"cannot construct path for inode (ino:%"PRId64", "
"gfid:%s)", inode->ino,
@@ -479,7 +479,7 @@ quota_get_limit_value (inode_t *inode, xlator_t *this, int64_t *n)
*n = 0;
ret = inode_path (inode, NULL, &path);
- if (ret < 0) {
+ if (ret <= 0) {
ret = -1;
goto out;
}
diff --git a/xlators/nfs/server/src/nfs-common.c b/xlators/nfs/server/src/nfs-common.c
index 168593cdffa..ab28f78e90f 100644
--- a/xlators/nfs/server/src/nfs-common.c
+++ b/xlators/nfs/server/src/nfs-common.c
@@ -255,7 +255,7 @@ nfs_inode_loc_fill (inode_t *inode, loc_t *loc)
ignore_parent:
ret = inode_path (inode, NULL, &resolvedpath);
- if (ret < 0)
+ if (ret <= 0)
goto err;
ret = nfs_loc_fill (loc, inode, parent, resolvedpath);
@@ -318,7 +318,7 @@ nfs_parent_inode_loc_fill (inode_t *parent, inode_t *entryinode, char *entry,
return ret;
ret = inode_path (parent, entry, &path);
- if (ret < 0)
+ if (ret <= 0)
goto err;
ret = nfs_loc_fill (loc, entryinode, parent, path);
@@ -380,7 +380,7 @@ nfs_entry_loc_fill (inode_table_t *itable, uuid_t pargfid, char *entry,
}
ret = inode_path (parent, entry, &resolvedpath);
- if (ret < 0) {
+ if (ret <= 0) {
ret = -3;
goto err;
}
diff --git a/xlators/protocol/client/src/client-handshake.c b/xlators/protocol/client/src/client-handshake.c
index b18d3a27e7e..fc8ed21b0be 100644
--- a/xlators/protocol/client/src/client-handshake.c
+++ b/xlators/protocol/client/src/client-handshake.c
@@ -597,7 +597,7 @@ protocol_client_reopendir (xlator_t *this, clnt_fd_ctx_t *fdctx)
conf = this->private;
ret = inode_path (inode, NULL, &path);
- if (ret < 0) {
+ if (ret <= 0) {
gf_log (this->name, GF_LOG_WARNING,
"couldn't build path from inode %s",
uuid_utoa (inode->gfid));
@@ -677,7 +677,7 @@ protocol_client_reopen (xlator_t *this, clnt_fd_ctx_t *fdctx)
conf = this->private;
ret = inode_path (inode, NULL, &path);
- if (ret < 0) {
+ if (ret <= 0) {
gf_log (this->name, GF_LOG_WARNING,
"couldn't build path from inode %s",
uuid_utoa (inode->gfid));