From 689555033ea8124a44f2a86ef40b1da8887b1086 Mon Sep 17 00:00:00 2001 From: dougal Date: Mon, 15 Sep 2025 12:18:00 +0100 Subject: [PATCH] b2: fix 1TB+ uploads Before this change the minimum chunk size would default to 96M which would allow a maximum size of just below 1TB file to be uploaded, due to the 10000 part rule for b2. Now the calculated chunk size is used so the chunk size can be 5GB making a max file size of 50TB. Fixes #8460 --- backend/b2/b2.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/backend/b2/b2.go b/backend/b2/b2.go index d87948e37..70e4c928a 100644 --- a/backend/b2/b2.go +++ b/backend/b2/b2.go @@ -2224,13 +2224,17 @@ func (f *Fs) OpenChunkWriter(ctx context.Context, remote string, src fs.ObjectIn return info, nil, err } + up, err := f.newLargeUpload(ctx, o, nil, src, f.opt.ChunkSize, false, nil, options...) + if err != nil { + return info, nil, err + } + info = fs.ChunkWriterInfo{ - ChunkSize: int64(f.opt.ChunkSize), + ChunkSize: up.chunkSize, Concurrency: o.fs.opt.UploadConcurrency, //LeavePartsOnError: o.fs.opt.LeavePartsOnError, } - up, err := f.newLargeUpload(ctx, o, nil, src, f.opt.ChunkSize, false, nil, options...) - return info, up, err + return info, up, nil } // Remove an object