]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Revert "LINUX: do not use d_invalidate to evict dentries"
authorMark Vitale <mvitale@sinenomine.net>
Thu, 30 Nov 2017 18:45:27 +0000 (13:45 -0500)
committerBenjamin Kaduk <kaduk@mit.edu>
Wed, 3 Jan 2018 05:40:52 +0000 (00:40 -0500)
Linux recently changed the semantics of d_invalidate() to:
- return void
- invalidate even a current working directory

OpenAFS commit c3bbf0b4444db88192eea4580ac9e9ca3de0d286 switched libafs
to use d_prune_aliases() instead.

However, since that commit, several things have happened:
- RHEL 7.4 changed the semantics of d_invalidate() such that it
  invalidates the cwd, but did NOT change the return type to void.
  This broke our autoconf test for detecting the new semantics.
- Further research reveals that d_prune_aliases() was not the best
  choice for replacing d_invalidate().  This is because for directories,
  d_prune_aliases() doesn't invalidate dentries when they are referenced
  by its children, and it doesn't walk the tree trying to invalidate
  child dentries.  So it can leave dentries dangling, if the only
  references to thos dentries are via children.

In preparation for future commits, revert
c3bbf0b4444db88192eea4580ac9e9ca3de0d286 .

Reviewed-on: https://gerrit.openafs.org/12788
Reviewed-by: Andrew Deason <adeason@dson.org>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 367693bd7da2de593e3329f6acc4a4d07621fb97)

Change-Id: I3dfa9127adf8424fe675e237194d6ade5a7fc4f1
Reviewed-on: https://gerrit.openafs.org/12846
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
src/afs/LINUX/osi_vcache.c

index 23040b12c7510e04d56061dfcaf291a4690c385f..bc74b674432d144773618887605660587e0bb9a7 100644 (file)
@@ -24,13 +24,6 @@ TryEvictDentries(struct vcache *avc)
     struct hlist_node *p;
 #endif
 
-#if defined(D_INVALIDATE_IS_VOID)
-    /* At this kernel level, d_invalidate always succeeds;
-     * that is, it will now invalidate even an active directory,
-     * Therefore we must use a different method to evict dentries.
-     */
-    d_prune_aliases(inode);
-#else
 #if defined(HAVE_DCACHE_LOCK)
     spin_lock(&dcache_lock);
 
@@ -85,7 +78,6 @@ restart:
     spin_unlock(&inode->i_lock);
 #endif /* HAVE_DCACHE_LOCK */
 inuse:
-#endif /* D_INVALIDATE_IS_VOID */
     return;
 }