summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaghavendra Talur <rtalur@redhat.com>2013-08-29 19:04:40 +0530
committerVijay Bellur <vbellur@redhat.com>2013-09-10 01:20:05 -0700
commit236216cba153cb2c270e63698ecb073601287fd4 (patch)
tree39386996e7ce6bc2bdcee1f21b1f08de3b449fb2
parent4995efd2280ceb2668145277984c5ea4a0af6e30 (diff)
api: Fill loc.path and loc.gfid before syncop_open.
syncop_open was crashing because of NULL dereference. This fixes that. Change-Id: I4bc48fac2a6c0b15c806cbbb4ae45c67891ab7ed BUG: 1002577 Signed-off-by: Raghavendra Talur <rtalur@redhat.com> Reviewed-on: http://review.gluster.org/5877 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
-rw-r--r--api/src/glfs-resolve.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/api/src/glfs-resolve.c b/api/src/glfs-resolve.c
index a6698f8b9..3179af22c 100644
--- a/api/src/glfs-resolve.c
+++ b/api/src/glfs-resolve.c
@@ -593,6 +593,15 @@ glfs_migrate_fd_safe (struct glfs *fs, xlator_t *newsubvol, fd_t *oldfd)
loc.inode = inode_ref (newinode);
+ ret = inode_path (oldfd->inode, NULL, (char **)&loc.path);
+ if (ret < 0) {
+ gf_log (fs->volname, GF_LOG_INFO, "inode_path failed");
+ goto out;
+ }
+
+ uuid_copy (loc.gfid, oldinode->gfid);
+
+
if (IA_ISDIR (oldinode->ia_type))
ret = syncop_opendir (newsubvol, &loc, newfd);
else