vfs: fix race between multiple RWFileHandle (#2052)

Fixes #2034
This commit is contained in:
Fabian Möller
2018-02-18 14:12:26 +01:00
committed by GitHub
parent 358c1fbac9
commit 62e72801be
4 changed files with 202 additions and 127 deletions

View File

@@ -181,7 +181,7 @@ func (fh *WriteFileHandle) close() (err error) {
}
fh.closed = true
// leave writer open until file is transferred
defer fh.file.delWriter(fh)
defer fh.file.delWriter(fh, false)
// If file not opened and not safe to truncate then then leave file intact
if !fh.opened && !fh.safeToTruncate() {
return nil