summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/gf-dirent.c
diff options
context:
space:
mode:
authorKrutika Dhananjay <kdhananj@redhat.com>2014-12-05 14:35:08 +0530
committerVijay Bellur <vbellur@redhat.com>2014-12-09 20:15:21 -0800
commitad1ed8006047e862810f43d818dc44534e953d91 (patch)
treedc786bffb1a185c596677d3cd0b191edd56dcbb3 /libglusterfs/src/gf-dirent.c
parentecb58c9a3f716a87da7174c1aa721561b18ad27b (diff)
cluster/afr: Associate the inode returned by inode_link() with corresponding entry
Change-Id: Ic4436a64075a2615a2293cdfdf2ba6622827cafa BUG: 1129939 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/9254 Reviewed-by: Emmanuel Dreyfus <manu@netbsd.org> Tested-by: Emmanuel Dreyfus <manu@netbsd.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'libglusterfs/src/gf-dirent.c')
-rw-r--r--libglusterfs/src/gf-dirent.c5
1 files changed, 4 insertions, 1 deletions
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);
}
}