forked from TrueCloudLab/frostfs-node
[#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:
parent
67c97c6804
commit
792319a044
1 changed files with 1 additions and 0 deletions
|
@ -244,6 +244,7 @@ func (t *FSTree) Put(prm common.PutPrm) (common.PutRes, error) {
|
||||||
var pe *fs.PathError
|
var pe *fs.PathError
|
||||||
if errors.As(err, &pe) && pe.Err == syscall.ENOSPC {
|
if errors.As(err, &pe) && pe.Err == syscall.ENOSPC {
|
||||||
err = common.ErrNoSpace
|
err = common.ErrNoSpace
|
||||||
|
_ = os.RemoveAll(p)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue