From fdc2f692183cbe1cebeb305d8c7f7f2af71c14ba Mon Sep 17 00:00:00 2001 From: Klaus Post Date: Tue, 9 Mar 2021 23:42:24 +0100 Subject: [PATCH] truncate xl.meta files upon rewrites #11749) If the destination files exist and is larger - junk data will be left at the end of the file. --- cmd/xl-storage.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/xl-storage.go b/cmd/xl-storage.go index 126298cb4..295875fa3 100644 --- a/cmd/xl-storage.go +++ b/cmd/xl-storage.go @@ -1619,7 +1619,7 @@ func (s *xlStorage) WriteAll(ctx context.Context, volume string, path string, b atomic.AddInt32(&s.activeIOCount, -1) }() - w, err := s.openFile(volume, path, os.O_CREATE|os.O_WRONLY) + w, err := s.openFile(volume, path, os.O_CREATE|os.O_WRONLY|os.O_TRUNC) if err != nil { return err }