From 63c0dc773c8fc35ec17c5637cbae3ec7c159b4c0 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 e54d7a439..379154abc 100644 --- a/backend/b2/b2.go +++ b/backend/b2/b2.go @@ -2192,13 +2192,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