Hi

 

We are having a samba server exporting a locally mounted ganesha share and we have our own FSAL implementation.

Samba share consistently get stuck during readdir operation on NFS export in particular sequence of operations from samba on ganesha export.

These are particular set of operations before it gets stuck:

 

  1. There are around 160 files in the folder and readdir output looks like
    .
    ..
    file1
    file2
    file3
    file4
    …..and so on
  2. file2 and file3 in the previous readdir output are deleted.
  3. readdir_ex calls from FSAL now return following one by one
    .
    ..
    file1
    file4
  4. After it returns file4, readdir call from ganesha returns NFS4ERR_DELAY to client with following error in ganesha logs:

12/01/2021 03:24:32 : epoch 5ffc6dd5 : <machine> : ganesha.nfsd-20352[svc_168] mdcache_avl_insert_ck :NFS READDIR :DEBUG :NFS READDIR: DEBUG: Already existent when inserting dirent 0x7f0b6c0d8c40 for <filename> on entry=0x7f0b6802dfb0 FSAL cookie=4, duplicated directory cookies make READDIR unreliable.

  1. ls -l  command on the directory over local mount also gets stuck for few mins.
  2. Previous readdir calls logs between (before files were deleted In #2) reveal that the file4 had cookie=6 and that’s where ganesha throws an error
    12/01/2021 03:24:08 : epoch 5ffc6dd5 : OneCSUnixMa.idcprodcert.loc : ganesha.nfsd-20352[svc_173] mdcache_avl_insert_ck :NFS READDIR :F_DBG :NFS READDIR: FULLDEBUG: Insert dirent 0x7f0b68020cb0 for collection-101-3540931298411264490.wt on entry=0x7f0b6802dfb0 FSAL cookie=6

 

So couple of questions:

  1. What is the cookie value we should send to avoid this error occurring during insertion in AVL tree? We currently return the offset of the entry in cookie.
  2. Do we need to invalidate the mdcache of ganesha using up-call whenever there is a change in the files inside the underlying dirent due to rename or delete operation?

 

Thanks

Sandeep