Commit 75a65d4a authored by Aaron Jacobs's avatar Aaron Jacobs

Fixed a locking bug.

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