From 0244caf13adc5584bcde1356486b2cc8bfe7a433 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Fri, 24 Nov 2023 17:43:06 +0000 Subject: [PATCH] serve s3: fix overwrite of files with 0 length file Before this change overwriting an existing file with a 0 length file didn't update the file size. This change corrects the issue and makes sure the file is truncated properly. This was discovered by the full integration tests. --- cmd/serve/s3/backend.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/cmd/serve/s3/backend.go b/cmd/serve/s3/backend.go index 305012f34..397760102 100644 --- a/cmd/serve/s3/backend.go +++ b/cmd/serve/s3/backend.go @@ -282,11 +282,6 @@ func (b *s3Backend) PutObject( } } - if size == 0 { - // maybe a touch operation - return b.TouchObject(fp, meta) - } - f, err := b.vfs.Create(fp) if err != nil { return result, err