From c2733b13aaa6d38eb165e770a936f8bfc19bc685 Mon Sep 17 00:00:00 2001 From: Shehjar Tikoo Date: Thu, 23 Jul 2009 16:18:43 +0000 Subject: libglusterfsclient: Fill new loc with target's ino on link In the loc_t of the link being created, we must fill in the inode of the old/target loc since this is a link operation. The inode_link to the new parent is called in libgf_client_link. This fixes a crash while running fileop over a fully-loaded dist-repl vol file. Ref: Bugzilla 161 Signed-off-by: Anand V. Avati BUG: 161 (unfs3 crashes on link system call by fileop) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=161 --- libglusterfsclient/src/libglusterfsclient.c | 1 + 1 file changed, 1 insertion(+) (limited to 'libglusterfsclient/src/libglusterfsclient.c') diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c index 1cdad125a..abdc756a4 100755 --- a/libglusterfsclient/src/libglusterfsclient.c +++ b/libglusterfsclient/src/libglusterfsclient.c @@ -5402,6 +5402,7 @@ glusterfs_glh_link (glusterfs_handle_t handle, const char *oldpath, } newname = strdup (new.path); + new.inode = inode_ref (old.inode); libgf_client_loc_fill (&new, ctx, 0, new.parent->ino, basename (newname)); op_ret = libgf_client_link (ctx, &old, &new); -- cgit