]> git.ipfire.org Git - thirdparty/systemd.git/commit
loop-device: implicitly sync device on detach
authorLennart Poettering <lennart@poettering.net>
Thu, 30 Jul 2020 16:42:13 +0000 (18:42 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 30 Jul 2020 18:56:13 +0000 (20:56 +0200)
commitcae1e8fb88c5a6b0960a2d0be3df8755f0c78462
tree9d48409c740837466558cf44c88be5927393ad65
parent3660da17b0d6a0954a7e90eaca58d35ae53846e2
loop-device: implicitly sync device on detach

Apparently, if IO is still in flight at the moment we invoke LOOP_CLR_FD
it is likely simply dropped (probably because yanking physical storage,
such as a USB stick would drop it too). Let's protect ourselves against
that and always sync explicitly before we invoke it.
src/shared/loop-util.c