[#2208] fstree: Remove file if there was an error during write

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
remotes/carpawell/fix/multiple-cache-update-requests-FROST
Evgenii Stratonikov 2023-01-20 15:41:24 +03:00 committed by fyrchik
parent 67c97c6804
commit 792319a044
1 changed files with 1 additions and 0 deletions

View File

@ -244,6 +244,7 @@ func (t *FSTree) Put(prm common.PutPrm) (common.PutRes, error) {
var pe *fs.PathError
if errors.As(err, &pe) && pe.Err == syscall.ENOSPC {
err = common.ErrNoSpace
_ = os.RemoveAll(p)
}
}