From bfc9f1f8d94db1d666e549f3e382be75839c1bf7 Mon Sep 17 00:00:00 2001 From: Krutika Dhananjay Date: Fri, 5 Dec 2014 14:35:08 +0530 Subject: cluster/afr: Associate the inode returned by inode_link() with corresponding entry Backport of: http://review.gluster.org/9254 Change-Id: I7d2be4d41413f4df7d0b2d1d545d61f384f7a0c3 BUG: 1138897 Signed-off-by: Krutika Dhananjay Reviewed-on: http://review.gluster.org/9260 Reviewed-by: Pranith Kumar Karampuri Tested-by: Gluster Build System Reviewed-by: Raghavendra Bhat Tested-by: Raghavendra Bhat --- libglusterfs/src/gf-dirent.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'libglusterfs/src') diff --git a/libglusterfs/src/gf-dirent.c b/libglusterfs/src/gf-dirent.c index 0cda83a27c3..3b42a0813d5 100644 --- a/libglusterfs/src/gf-dirent.c +++ b/libglusterfs/src/gf-dirent.c @@ -78,6 +78,7 @@ gf_link_inodes_from_dirent (xlator_t *this, inode_t *parent, { gf_dirent_t *entry = NULL; inode_t *link_inode = NULL; + inode_t *tmp = NULL; list_for_each_entry (entry, &entries->list, list) { if (entry->inode) { @@ -86,7 +87,9 @@ gf_link_inodes_from_dirent (xlator_t *this, inode_t *parent, if (!link_inode) continue; inode_lookup (link_inode); - inode_unref (link_inode); + tmp = entry->inode; + entry->inode = link_inode; + inode_unref (tmp); } } -- cgit