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>
This commit is contained in:
Poornima G 2014-02-19 14:12:29 +05:30 committed by Anand Avati
parent da7972c10c
commit ff0cd7c4e3

View File

@ -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);