fix: Prevent deadlock when calling fs.Create

This commit is contained in:
Felix Pojtinger
2022-01-03 16:59:56 +01:00
parent 32fe31c5e8
commit 8ed551b3c4

View File

@@ -78,10 +78,7 @@ func (f *STFS) Create(name string) (afero.File, error) {
"name": name,
})
f.ioLock.Lock()
defer f.ioLock.Unlock()
return os.OpenFile(name, os.O_CREATE, 0666)
return f.OpenFile(name, os.O_CREATE|os.O_RDWR, 0666)
}
func (f *STFS) mknodeWithoutLocking(dir bool, name string, perm os.FileMode, overwrite bool, linkname string) error {