summaryrefslogtreecommitdiffstats
path: root/api/src/glfs-resolve.c
diff options
context:
space:
mode:
authorRaghavendra Talur <rtalur@redhat.com>2013-08-29 19:04:40 +0530
committerAnand Avati <avati@redhat.com>2013-08-29 13:52:28 -0700
commit2ec4b22bb02f572f74157df5264b247095fece77 (patch)
tree0d2e5cba60c9828045daa53f04c1451627d7a625 /api/src/glfs-resolve.c
parent7dd4be82b1a346077673fde9218ae7c8ad8e11e0 (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/5734 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'api/src/glfs-resolve.c')
-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 beb270322eb..ec8890b2dcf 100644
--- a/api/src/glfs-resolve.c
+++ b/api/src/glfs-resolve.c
@@ -583,6 +583,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