From: Lennart Poettering Date: Wed, 27 Aug 2025 19:42:39 +0000 (+0200) Subject: loop-util: fully suppress unnecessary size changes X-Git-Tag: v259-rc1~449 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ec3139db8b044b9883531c2e9d3adf8c180266fe;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/shared/loop-util.c b/src/shared/loop-util.c index b60e66c37e3..53d7759e2ef 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)