summaryrefslogtreecommitdiffstats
path: root/libglusterfsclient
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@gluster.com>2009-07-23 16:18:43 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-07-27 09:32:27 -0700
commit955c6e0c87b501501d87806f1e69ece8f0559dd6 (patch)
treedfcdd38e03aea2c42e1071d59a48c59bdade602c /libglusterfsclient
parent48755d7eaf9d22e4707b7abc7b3df46256fa6069 (diff)
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 <avati@dev.gluster.com> BUG: 161 (unfs3 crashes on link system call by fileop) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=161
Diffstat (limited to 'libglusterfsclient')
-rwxr-xr-xlibglusterfsclient/src/libglusterfsclient.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c
index eaa86d913..ec41710f8 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);