Fixed a locking bug.

geesefs-0-30-9
Aaron Jacobs 2015-03-03 09:39:45 +11:00
parent b6e50a1953
commit 75a65d4a03
1 changed files with 2 additions and 1 deletions

View File

@ -149,8 +149,9 @@ func (fs *memFS) getInodeForReadingOrDie(id fuse.InodeID) (inode *inode) {
// EXCLUSIVE_LOCK_FUNCTION(inode.mu)
func (fs *memFS) allocateInode(
mode os.FileMode) (id fuse.InodeID, inode *inode) {
// Create the inode.
// Create and lock the inode.
inode = newInode(mode)
inode.mu.Lock()
// Re-use a free ID if possible. Otherwise mint a new one.
numFree := len(fs.freeInodes)