diff options
Diffstat (limited to 'api/src/glfs-fops.c')
| -rw-r--r-- | api/src/glfs-fops.c | 12 | 
1 files changed, 10 insertions, 2 deletions
diff --git a/api/src/glfs-fops.c b/api/src/glfs-fops.c index f7688f30743..54eb2603f38 100644 --- a/api/src/glfs-fops.c +++ b/api/src/glfs-fops.c @@ -3300,12 +3300,20 @@ glfd_entry_refresh(struct glfs_fd *glfd, int plus)          if (plus) {              list_for_each_entry(entry, &entries.list, list)              { -                if (!entry->inode && !IA_ISDIR(entry->d_stat.ia_type)) { +                if ((!entry->inode && (!IA_ISDIR(entry->d_stat.ia_type))) || +                    ((entry->d_stat.ia_ctime == 0) && +                     strcmp(entry->d_name, ".") && +                     strcmp(entry->d_name, ".."))) {                      /* entry->inode for directories will be                       * always set to null to force a lookup -                     * on the dentry. Also we will have +                     * on the dentry. Hence to not degrade +                     * readdir performance, we skip lookups +                     * for directory entries. Also we will have                       * proper stat if directory present on                       * hashed subvolume. +                     * +                     * In addition, if the stat is invalid, force +                     * lookup to fetch proper stat.                       */                      gf_fill_iatt_for_dirent(entry, fd->inode, subvol);                  }  | 
