9ae3f9
From f027734165374979bd0bff8ea059dfaadca85e07 Mon Sep 17 00:00:00 2001
9ae3f9
From: Soumya Koduri <skoduri@redhat.com>
9ae3f9
Date: Thu, 2 Jul 2020 02:07:56 +0530
9ae3f9
Subject: [PATCH 462/465] Issue with gf_fill_iatt_for_dirent
9ae3f9
9ae3f9
In "gf_fill_iatt_for_dirent()", while calculating inode_path for loc,
9ae3f9
the inode should be of parent's. Instead it is loc.inode which results in error
9ae3f9
 and eventually lookup/readdirp fails.
9ae3f9
9ae3f9
This patch fixes the same.
9ae3f9
9ae3f9
This is backport of below mainstream fix :
9ae3f9
9ae3f9
> Change-Id: Ied086234a4634e8cb13520521ac547c87b3c76b5
9ae3f9
> Fixes: #1351
9ae3f9
> Upstream patch: https://review.gluster.org/#/c/glusterfs/+/24661/
9ae3f9
9ae3f9
Change-Id: Ied086234a4634e8cb13520521ac547c87b3c76b5
9ae3f9
BUG: 1853189
9ae3f9
Signed-off-by: Soumya Koduri <skoduri@redhat.com>
9ae3f9
Reviewed-on: https://code.engineering.redhat.com/gerrit/208691
9ae3f9
Tested-by: RHGS Build Bot <nigelb@redhat.com>
9ae3f9
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
9ae3f9
---
9ae3f9
 libglusterfs/src/gf-dirent.c | 2 +-
9ae3f9
 1 file changed, 1 insertion(+), 1 deletion(-)
9ae3f9
9ae3f9
diff --git a/libglusterfs/src/gf-dirent.c b/libglusterfs/src/gf-dirent.c
9ae3f9
index f289723..3fa67f2 100644
9ae3f9
--- a/libglusterfs/src/gf-dirent.c
9ae3f9
+++ b/libglusterfs/src/gf-dirent.c
9ae3f9
@@ -277,7 +277,7 @@ gf_fill_iatt_for_dirent(gf_dirent_t *entry, inode_t *parent, xlator_t *subvol)
9ae3f9
     gf_uuid_copy(loc.pargfid, parent->gfid);
9ae3f9
     loc.name = entry->d_name;
9ae3f9
     loc.parent = inode_ref(parent);
9ae3f9
-    ret = inode_path(loc.inode, entry->d_name, &path);
9ae3f9
+    ret = inode_path(loc.parent, entry->d_name, &path);
9ae3f9
     loc.path = path;
9ae3f9
     if (ret < 0)
9ae3f9
         goto out;
9ae3f9
-- 
9ae3f9
1.8.3.1
9ae3f9