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
Unified · Split
| @@ -403,6 +403,10 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e · 402 unmodified lines | ||
| 403 | 403 | if err != nil { |
| 404 | 404 | 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 | 410 | err = checkUploadCutoff(opt, opt.UploadCutoff) |
| 407 | 411 | if err != nil { |
| 408 | 412 | return nil, errors.Wrap(err, "b2: upload cutoff") |