From 587d7fa96dc35859eb5bba740bce24d796d0b1e1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Wed, 11 Jun 2025 19:22:11 +0200 Subject: [PATCH] modules/prefill: fix moving across filesystems I somehow thought thought that `os.rename()` behaves like the `mv` command, and unfortunately in the way I tested this, everything was inside a single mount-point. Official docs is one line that doesn't explain anything really :-/ --- NEWS | 1 + modules/prefill/prefill.lua | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 2af1d8f62..691df0e06 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,7 @@ Bugfixes - /network/edns-buffer-size: fix swapped upstream+downstream (!1711) - cache: fix a crash in case garbage collection is too slow (!1713) [system] assertion "env->is_cache" failed in cdb_write +- /cache/prefill: fix 6.0.13 regression (!1705) Knot Resolver 6.0.14 (2025-06-03) diff --git a/modules/prefill/prefill.lua b/modules/prefill/prefill.lua index 58849f5ab..e6ae2f462 100644 --- a/modules/prefill/prefill.lua +++ b/modules/prefill/prefill.lua @@ -70,7 +70,8 @@ end local function download(url, fname) local kluautil = require('kluautil') - local fname_tmp = os.tmpname() + -- fname_tmp is in the same directory, as os.rename below refuses to work across filesystems + local fname_tmp = fname .. '.' .. worker.id .. '.tmp' local file, ok, errmsg file, errmsg = io.open(fname_tmp, 'w') if not file then -- 2.47.2