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