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

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2023-01-20 15:41:24 +03:00 committed by fyrchik
parent 67c97c6804
commit 792319a044

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)
}
}