|
|
Subscribe / Log in / New account

Dentry negativity

Dentry negativity

Posted Mar 14, 2020 15:39 UTC (Sat) by dezgeg (subscriber, #92243)
In reply to: Dentry negativity by pr1268
Parent article: Dentry negativity

Steps 4. and 5. are just a single step: the existing negative dentry for cowbell is turned into a positive one. All file creations are done this way (regardless of whether the cowbell negative dentry existed in memory due to openat attempt or not).


to post comments

Dentry negativity

Posted Mar 15, 2020 7:34 UTC (Sun) by NYKevin (subscriber, #129325) [Link]

Just to clarify, are you saying that the kernel is doing this?

  1. Check for a matching dentry in the cache.
  2. If the dentry is absent from cache, do a "real" lookup of the path in question.
  3. Now the dentry is definitely in cache, either because it was already there or because the previous step caused it to become cached.
  4. If the cached dentry is positive, open it or fail with EEXIST as appropriate for the state of the O_EXCL flag.
  5. If the cached dentry is negative, change it to positive and mark it dirty.
  6. That's it. Eventually, the cached dentry will get written out to disk, but that's not our problem right now.

(Obviously, I have omitted numerous failure modes which we don't need to care about for the purposes of this discussion.)


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds