summaryrefslogtreecommitdiffstats
path: root/api/src
diff options
context:
space:
mode:
authorMohammed Rafi KC <rkavunga@redhat.com>2016-04-26 16:59:30 +0530
committergluster-ant <bugzilla-bot@gluster.org>2016-04-26 16:59:30 +0530
commit72f290b406fee16761abf09d899758fa74dfee74 (patch)
tree616b00f29a4ddb3b4d13a4b12ff2d862ebd3054a /api/src
parent4504778813aa14f8ccccedd38eb161e46c298940 (diff)
gfapi: fill iatt in readdirp_cbk if entry->inode is null
If any of dirent have inode as null in readdirp_cbk, which indicates that the stat information is not valid. So for such entries, we send explicit lookup to fill the stat information. Change-Id: I0604bce34583db0bb04b5aae8933766201c6ddad BUG: 1330567 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> Reviewed-on: http://review.gluster.org/14079 NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Smoke: Gluster Build System <jenkins@build.gluster.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>
Diffstat (limited to 'api/src')
-rw-r--r--api/src/glfs-fops.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/api/src/glfs-fops.c b/api/src/glfs-fops.c
index 25492ef244..7e196e1eeb 100644
--- a/api/src/glfs-fops.c
+++ b/api/src/glfs-fops.c
@@ -2508,6 +2508,17 @@ glfd_entry_refresh (struct glfs_fd *glfd, int plus)
list_for_each_entry (entry, &entries.list, list) {
if (entry->inode)
inode_set_need_lookup (entry->inode, THIS);
+ else if (!IA_ISDIR (entry->d_stat.ia_type)) {
+ /* entry->inode for directories will be
+ * always set to null to force a lookup
+ * on the dentry. Also we will have
+ * proper stat if directory present on
+ * hashed subvolume.
+ */
+ gf_fill_iatt_for_dirent (entry,
+ fd->inode,
+ subvol);
+ }
}
gf_link_inodes_from_dirent (THIS, fd->inode, &entries);