summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorPoornima G <pgurusid@redhat.com>2014-02-19 14:12:29 +0530
committerAnand Avati <avati@redhat.com>2014-02-19 17:09:30 -0800
commitff0cd7c4e326d848d5fa6591c7cc8ce54711d2d7 (patch)
tree180d14fa8fa07cc5038d1e292f54ff034050ad71 /api
parentda7972c10cd0495621ea95c186db86cfa8d997b6 (diff)
libgfapi: In glfs_resolve_at(), do not override the previous return value.
Overriding ret to contain glfs_loc_touchup()s' return value implies that if glfs_loc_touchup() is successful, glfs_resolve_at() is also successful which is not necessarily true. This was causing glfs_resolve_at() to succeed even if it couldn't resolve, thus create and other fops would fail. Hence overriding ret only if glfs_loc_touchup() fails. Change-Id: I0804afbd120b3798abe07e870bfc40bf162bc289 BUG: 1066837 Signed-off-by: Poornima G <pgurusid@redhat.com> Reviewed-on: http://review.gluster.org/7125 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'api')
-rw-r--r--api/src/glfs-resolve.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/api/src/glfs-resolve.c b/api/src/glfs-resolve.c
index 0ad9ce723c8..7cd1e47bc8f 100644
--- a/api/src/glfs-resolve.c
+++ b/api/src/glfs-resolve.c
@@ -450,7 +450,9 @@ glfs_resolve_at (struct glfs *fs, xlator_t *subvol, inode_t *at,
ret = 0;
}
- ret = glfs_loc_touchup (loc);
+ if (glfs_loc_touchup (loc) < 0) {
+ ret = -1;
+ }
out:
GF_FREE (path);