Hello,

In mdcache_unlink, ganesha removes the dirent from its parent by calling mdcache_dirent_remove(). It also clears MDCACHE_TRUST_ATTRS. So, if a subsequent GETATTR comes for the parent (which can happen in the same compound from nfs4_op_remove), it frees all entries at the end of mdcache_refresh_attrs(). In this scenario, isn't it possible to keep the rest of dirents intact?

I'm thinking if we update parents attrs in unlink itself, would it prevent any further refreshes? The use case here is large directories with frequent additions/deletions/enumerations.

Thanks,
Pradeep