From 1d52eae8532e027a97dd947b3889b38abe0c113c Mon Sep 17 00:00:00 2001 From: Mohammed Rafi KC Date: Tue, 26 Apr 2016 16:59:30 +0530 Subject: 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. Backport of> >Change-Id: I0604bce34583db0bb04b5aae8933766201c6ddad >BUG: 1330567 >Signed-off-by: Mohammed Rafi KC >Reviewed-on: http://review.gluster.org/14079 >NetBSD-regression: NetBSD Build System >Smoke: Gluster Build System >CentOS-regression: Gluster Build System >Reviewed-by: Niels de Vos (cherry picked from commit 9423bdeed169076ebedd9af40b52aaac58c9839e) Change-Id: I90a218c78d5544a3b49b29079c64a8b76e7939df BUG: 1331263 Signed-off-by: Mohammed Rafi KC Reviewed-on: http://review.gluster.org/14109 Smoke: Gluster Build System CentOS-regression: Gluster Build System NetBSD-regression: NetBSD Build System Reviewed-by: Rajesh Joseph --- api/src/glfs-fops.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'api') diff --git a/api/src/glfs-fops.c b/api/src/glfs-fops.c index 6f67e6c5b9e..ff7f4570b5a 100644 --- a/api/src/glfs-fops.c +++ b/api/src/glfs-fops.c @@ -2601,6 +2601,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); -- cgit