local: don't ignore preallocate disk full errors

See: https://forum.rclone.org/t/input-output-error-copying-to-cifs-mount-disk-space-filled/22163
This commit is contained in:
Nick Craig-Wood 2021-02-17 13:06:24 +00:00
parent b9bf91c510
commit 89e8fb4818

View File

@ -1145,6 +1145,10 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op
err = file.PreAllocate(src.Size(), f)
if err != nil {
fs.Debugf(o, "Failed to pre-allocate: %v", err)
if err == file.ErrDiskFull {
_ = f.Close()
return err
}
}
}
out = f