]> git.ipfire.org Git - thirdparty/systemd.git/commit
sysupdate: Prevent a possible invalid partial+pending state on an instance
authorPhilip Withnall <pwithnall@gnome.org>
Wed, 22 Apr 2026 16:19:21 +0000 (17:19 +0100)
committerPhilip Withnall <pwithnall@gnome.org>
Wed, 22 Apr 2026 16:19:21 +0000 (17:19 +0100)
commit0d02d0bc51f2fd431f81daa39a970d5dea279f29
tree96c78e3df59d4c88706d18ffef77d8be8f4e8807
parenta84bbd15d964d02fd0f5d688865b39eeeae38d99
sysupdate: Prevent a possible invalid partial+pending state on an instance

If the resource code is recursing, it’s possible for one iteration to
set a partial flag, and then a recursive iteration to set a pending flag
(or vice-versa). It doesn’t make sense to have both set at the same time
for a specific instance, so make sure to clear the other flag when
setting one of them.

Add some assertions to make this invariant clearer and easier to debug
if it fails.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
src/sysupdate/sysupdate-resource.c
src/sysupdate/sysupdate.c