summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendrabhat@gluster.com>2010-12-08 22:55:24 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-12-12 20:07:21 -0800
commit48d6fe293a487727d4686f64ef410a3df569f6a8 (patch)
tree6c32b386f6b1d3baf14e5a468297b9df04ab7969 /xlators
parent40e1d364161b45299fcefd50879d532a01f4d2b5 (diff)
check the return value properly after calling inode_path
Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 2203 ([glusterfs 3.1.1]: Core generated with Segmentation fault in afr-open.c) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2203
Diffstat (limited to 'xlators')
-rw-r--r--xlators/cluster/afr/src/afr-open.c2
-rw-r--r--xlators/mount/fuse/src/fuse-resolve.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/xlators/cluster/afr/src/afr-open.c b/xlators/cluster/afr/src/afr-open.c
index 44ba22ee77a..074a9d32c66 100644
--- a/xlators/cluster/afr/src/afr-open.c
+++ b/xlators/cluster/afr/src/afr-open.c
@@ -372,7 +372,7 @@ afr_prepare_loc (call_frame_t *frame, fd_t *fd)
local = frame->local;
ret = inode_path (fd->inode, NULL, (char **)&path);
- if (ret == -1)
+ if (ret <= 0)
return -1;
if (local->loc.path) {
diff --git a/xlators/mount/fuse/src/fuse-resolve.c b/xlators/mount/fuse/src/fuse-resolve.c
index 0835d5d1a04..e89b4423151 100644
--- a/xlators/mount/fuse/src/fuse-resolve.c
+++ b/xlators/mount/fuse/src/fuse-resolve.c
@@ -410,7 +410,7 @@ gf_resolve_fd (fuse_state_t *state)
}
ret = inode_path (fd->inode, 0, &path);
- if (!ret || !path)
+ if (ret <= 0)
gf_log ("", GF_LOG_WARNING,
"failed to do inode-path on fd %d %s", ret, path);