From: Linus Torvalds Date: Wed, 20 Apr 2005 01:09:04 GMT Subject: Re: [PATCH] write-tree performance problems Message-ID: In-Reply-To: <200504192049.21947.mason@suse.com> On Tue, 19 Apr 2005, Chris Mason wrote: > > 5) right before exiting, write-tree updates the index if it made any changes. This part won't work. It needs to do the proper locking, which means that it needs to create "index.lock" _before_ it reads the index file, and write everything to that one and then do a rename. If it doesn't need to do the write, it can just remove index.lock without writing to it, obviously. > The downside to this setup is that I've got to change other index users to > deal with directory entries that are there sometimes and missing other times. > The nice part is that I don't have to "invalidate" the directory entry, if it > is present, it is valid. To me, the biggest downside is actually the complexity part, and worrying about the directory index ever getting stale. How big do the changes end up being? Linus