From 56dba3f1fe87f119e05b74787197ec776ef2692d Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 4 Jul 2025 08:20:43 +0100 Subject: [PATCH] file: zero: Print the debug message on the fallback path once Use the new ONCE() macro to print the debug message when we fall back to emulating zero only once. (Actually the core server code contains a similar message so we probably don't need this at all.) (cherry picked from commit fbb5d8211bf4c30144d01be80720e1a63ecd6e81) --- plugins/file/file.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/file/file.c b/plugins/file/file.c index 9c43ff24..b881da37 100644 --- a/plugins/file/file.c +++ b/plugins/file/file.c @@ -71,6 +71,7 @@ #include "isaligned.h" #include "ispowerof2.h" #include "minmax.h" +#include "once.h" #include "utils.h" static enum { @@ -1165,7 +1166,7 @@ file_zero (void *handle, uint32_t count, uint64_t offset, uint32_t flags) /* Trigger a fall back to writing */ if (file_debug_zero) - nbdkit_debug ("zero falling back to writing"); + ONCE (nbdkit_debug ("%s: zero falling back to writing", h->name)); errno = EOPNOTSUPP; return -1; -- 2.47.1