[#211] fstree: Consider ENOSPC a logical error

We already do this for file writing, however directory creation can also
fail.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
pull/211/head
Evgenii Stratonikov 2023-04-05 10:43:48 +03:00
parent 0948a280fa
commit 48e7100556
1 changed files with 3 additions and 0 deletions

View File

@ -228,6 +228,9 @@ func (t *FSTree) Put(prm common.PutPrm) (common.PutRes, error) {
p := t.treePath(prm.Address)
if err := util.MkdirAllX(filepath.Dir(p), t.Permissions); err != nil {
if errors.Is(err, syscall.ENOSPC) {
return common.PutRes{}, common.ErrNoSpace
}
return common.PutRes{}, err
}
if !prm.DontCompress {