Fix concurrent map read and map write
This commit is contained in:
parent
d8c5b27d89
commit
83f94e1ef5
@ -355,7 +355,11 @@ func (fs *memFilesystem) Symlink(oldname, newname string) error {
|
||||
func (fs *memFilesystem) WriteFileReader(path string, r io.Reader) (int64, bool, error) {
|
||||
path = fs.cleanPath(path)
|
||||
|
||||
if fs.isDir(path) {
|
||||
fs.filesLock.Lock()
|
||||
isdir := fs.isDir(path)
|
||||
fs.filesLock.Unlock()
|
||||
|
||||
if isdir {
|
||||
return -1, false, fmt.Errorf("path not writeable")
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user