]> git.ipfire.org Git - thirdparty/systemd.git/commit
switch-root: disable sync() again when we switch root during shutdown
authorLennart Poettering <lennart@poettering.net>
Fri, 19 May 2023 13:52:43 +0000 (15:52 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 2 Jun 2023 14:49:39 +0000 (16:49 +0200)
commit1795252caa681b6b16e575ae2e5bd24a48f4e376
treec4015f5469f8a147df68fde1a89ed83a05308126
parent2932161bf6d9a8c127da00c9032e7e449222c9ea
switch-root: disable sync() again when we switch root during shutdown

Our shutdown binary that takes over as PID 1 when shutting down puts
great efforts into a sync() that comes with a time-out once sync'ing
process stops. If we'd add another dumb sync() here, we kinda defeat all
it is good for. Hence, let's keep the sync() in for most codepats, but
let's disable it for the final shutdown logic when we transition back
into the exitrd. After all we sync()ed more than enough here, no need to
sync() even more.
src/shared/switch-root.c
src/shared/switch-root.h
src/shutdown/shutdown.c