Skip to content

Commit d44fd3d

Browse files
skuppa-veevaskuppa
authored andcommitted
Fixing the creation of multiple inode creation for the same name when MkDir executed simultaneously.
1 parent 45b8d78 commit d44fd3d

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

internal/goofys.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,8 +1046,8 @@ func (fs *Goofys) MkDir(
10461046
op *fuseops.MkDirOp) (err error) {
10471047

10481048
fs.mu.RLock()
1049+
defer fs.mu.RUnlock()
10491050
parent := fs.getInodeOrDie(op.Parent)
1050-
fs.mu.RUnlock()
10511051

10521052
// ignore op.Mode for now
10531053
inode, err := parent.MkDir(op.Name)
@@ -1056,11 +1056,7 @@ func (fs *Goofys) MkDir(
10561056
}
10571057

10581058
parent.mu.Lock()
1059-
1060-
fs.mu.Lock()
1061-
defer fs.mu.Unlock()
10621059
fs.insertInode(parent, inode)
1063-
10641060
parent.mu.Unlock()
10651061

10661062
op.Entry.Child = inode.Id

0 commit comments

Comments
 (0)