History

b2: automatically raise upload cutoff to avoid spurious error

Before this change, if --b2-chunk-size was raised above 200M then this error would be produced: b2: upload cutoff: 200M is less than chunk size 1G This change automatically reaises --b2-upload-cutoff to be the value of --b2-chunk-size if it is below it, which stops this error being generated. Fixes #4475

Nick Craig-Wood committed 6 years ago

Commit 9710ded1 parent 5f367211 file · +4 −0Browse files

Unified · Split

backend/b2/b2.go+4−0
@@ -403,6 +403,10 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e · 402 unmodified lines
403 if err != nil {403 if err != nil {
404 return nil, err404 return nil, err
405 }405 }
406 if opt.UploadCutoff < opt.ChunkSize {
407 opt.UploadCutoff = opt.ChunkSize
408 fs.Infof(nil, "b2: raising upload cutoff to chunk size: %v", opt.UploadCutoff)
409 }
406 err = checkUploadCutoff(opt, opt.UploadCutoff)410 err = checkUploadCutoff(opt, opt.UploadCutoff)
407 if err != nil {411 if err != nil {
408 return nil, errors.Wrap(err, "b2: upload cutoff")412 return nil, errors.Wrap(err, "b2: upload cutoff")