The danger in not invalidating is that something that adds an entry races with the
deletion such that we miss the addition. Or even a deletion external to Ganesha.
Frank
From: Pradeep [mailto:pradeepthomas@gmail.com]
Sent: Sunday, February 28, 2021 11:19 PM
To: Frank Filz <ffilzlnx(a)mindspring.com>; Daniel Gryniewicz <dang(a)redhat.com>;
Ganesha-devel <devel(a)lists.nfs-ganesha.org>
Subject: [NFS-Ganesha-Devel] unlink of one dirent could invalidate all.
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