Commit 43c8f9d8 authored by Aaron Jacobs's avatar Aaron Jacobs

Fixed a bug in forgetfs.

This manifested as ForgetFSTest.MkDir pacicking now and then in a manner
like this:

    https://gist.githubusercontent.com/jacobsa/2d12150beca1043f71b0/raw/28e0a01a9276799ad820970a05b522367222c331/gistfile1.txt
parent 0f62458e
......@@ -66,6 +66,13 @@ func NewFileSystem() (fs *ForgetFS) {
// The root inode starts with a lookup count of one.
impl.inodes[cannedID_Root].IncrementLookupCount()
// The canned inodes are supposed to be stable from the user's point of view,
// so we should allow them to be looked up at any point even if the kernel
// has balanced its lookups with its forgets. Ensure that they never go to
// zero until the file system is destroyed.
impl.inodes[cannedID_Foo].IncrementLookupCount()
impl.inodes[cannedID_Bar].IncrementLookupCount()
// Set up the mutex.
impl.mu = syncutil.NewInvariantMutex(impl.checkInvariants)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment