From b29984df38c8d8a2df51eeea23927c8b9281c8c8 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Thu, 20 Mar 2025 12:53:51 +0100 Subject: [PATCH] libxl: avoid infinite loop in libxl__remove_directory() Infinitely retrying the rmdir() invocation makes little sense. While the original observation was the log filling the disk (due to repeated "Directory not empty" errors, in turn occurring for unclear reasons), the loop wants breaking even if there was no error message being logged (much like is done in the similar loops in libxl__remove_file() and libxl__remove_file_or_directory()). Fixes: c4dcbee67e6d ("libxl: provide libxl__remove_file et al") Signed-off-by: Jan Beulich Reviewed-by: Juergen Gross Acked-by: Anthony PERARD master commit: 68baeb5c4852e652b9599e049f40477edac4060e master date: 2025-03-13 10:23:10 +0100 --- tools/libs/light/libxl_utils.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/libs/light/libxl_utils.c b/tools/libs/light/libxl_utils.c index 506c5b5631..5ae8935344 100644 --- a/tools/libs/light/libxl_utils.c +++ b/tools/libs/light/libxl_utils.c @@ -577,6 +577,7 @@ int libxl__remove_directory(libxl__gc *gc, const char *dirpath) if (errno == EINTR) continue; LOGE(ERROR, "failed to remove emptied directory %s", dirpath); rc = ERROR_FAIL; + break; } out: -- 2.39.5