[Bugs] [Bug 1630804] libgfapi-python: test_listdir_with_stat and test_scandir failure on release 5 branch

bugzilla at redhat.com bugzilla at redhat.com
Fri Oct 12 07:29:06 UTC 2018


--- Comment #13 from Soumya Koduri <skoduri at redhat.com> ---
(In reply to Raghavendra G from comment #9)
> Following is the likely hypothesis:
> * readdir-ahead on seeing a write invalidates "attribute" (rest of iatt
> other than gfid and ia_type) information keeping "entry" (gfid, ia_type)
> information, by zeroing out the iatt corresponding to "attribute" part of
> iatt.
> * Fuse-bridge if it sees zeroed out attribute information, sets
> attribute_valid=0 to indicate kernel to consume only entry information and
> asking it to do explicit stats for attribute information.
> However, on gfapi this option of selectively sending entry information may
> not be available and hence the entire iatt is to be invalidated and no inode
> information returned (just like readdir).
> @Poornima/@niels/@soumya/@Shyam,
> How does gfapi handle dentries with zeroed out stats? What information does
> it send back to application?

FWIU from the code, it sends back that NULL stat to the application as is which
is incorrect as the applications are not aware and shall not do any special
handling for such cases. 

I think those cases are handled by setting entry->inode to NULL so that gfapi
does lookup on that dirent before filling up the stat. 

int glfd_entry_refresh(struct glfs_fd *glfd, int plus) {
  xlator_t *subvol = NULL;
  if (ret >= 0) {
    if (plus) {
      list_for_each_entry(entry, &entries.list, list) {
        if (!entry->inode && !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);

Here 'gf_fill_iatt_for_dirent' does lookup if entry->inode is NULL. So
readdir-ahead xlator should set entry->inode to NULL whenever it needs to
invalidate iatt, so that gfapi can perform lookup. 

However I fail to understand/remembr why the above check skips directory
entries. Wouldn't it result in skipping directories with entry->inode=NULL in
the readdir(p) response.

You are receiving this mail because:
You are the QA Contact for the bug.
You are on the CC list for the bug.

More information about the Bugs mailing list