From 40b53047f1fd0e3af16ed3edba6dfc54d7617e54 Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Mon, 13 Jul 2026 08:19:39 +0200 Subject: [PATCH] =?UTF-8?q?controller:=20atomicPromoteTar=20syncs=20via=20?= =?UTF-8?q?an=20O=5FRDWR=20handle=20=E2=80=94=20read-only=20fsync=20is=20r?= =?UTF-8?q?efused=20on=20Windows,=20which=20kept=20the=20dev-box=20green?= =?UTF-8?q?=20gate=20permanently=20red=20(Linux=20behavior=20unchanged)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Claude-Session: https://claude.ai/code/session_01GzammAMzsJTgpQHqxwM2bC --- controller/internal/backup/backup.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/controller/internal/backup/backup.go b/controller/internal/backup/backup.go index 0dce7f6..faa4560 100644 --- a/controller/internal/backup/backup.go +++ b/controller/internal/backup/backup.go @@ -553,7 +553,9 @@ func (m *Manager) tarVolumeOrDefault(volName, dumpDir string) ([]byte, error) { // error the tmp is left for the caller to remove; the final `.tar` is never touched here except by a // successful rename. func atomicPromoteTar(tmpPath, finalPath string) error { - f, err := os.Open(tmpPath) + // O_RDWR, not os.Open: fsync on a read-only handle is refused on Windows (dev-box test runs), + // while a writable handle syncs on every platform. Content is not modified. + f, err := os.OpenFile(tmpPath, os.O_RDWR, 0) if err != nil { return fmt.Errorf("opening tmp dump: %w", err) }