From ec3139db8b044b9883531c2e9d3adf8c180266fe Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 27 Aug 2025 21:42:39 +0200 Subject: [PATCH] loop-util: fully suppress unnecessary size changes Typically we set the offset argument to UINT64_MAX in most calls, but this caused us to not detect no-change invocations. Fix that. --- src/shared/loop-util.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/shared/loop-util.c b/src/shared/loop-util.c index b60e66c37e..53d7759e2e 100644 --- a/src/shared/loop-util.c +++ b/src/shared/loop-util.c @@ -1064,9 +1064,8 @@ int loop_device_refresh_size(LoopDevice *d, uint64_t offset, uint64_t size) { VALGRIND_MAKE_MEM_DEFINED(&info, sizeof(info)); #endif - if (size == UINT64_MAX && offset == UINT64_MAX) - return 0; - if (info.lo_sizelimit == size && info.lo_offset == offset) + if ((size == UINT64_MAX || info.lo_sizelimit == size) && + (offset == UINT64_MAX || info.lo_offset == offset)) return 0; if (size != UINT64_MAX)