diff options
author | Lennart Poettering <lennart@poettering.net> | 2020-09-22 11:21:27 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2020-09-23 18:33:48 +0200 |
commit | 32c4626c4c34a7deb9ddc5edfba98c3f171900c8 (patch) | |
tree | 56c870343d831112ef6390d3222fa8ef60b389a9 /src | |
parent | 1a269c4ee34a4fc98f2407996cc6bda82f3e03bf (diff) | |
download | systemd-32c4626c4c34a7deb9ddc5edfba98c3f171900c8.tar.gz |
shutdown: also fsync() MD devices when going down
Let's make this explicit, just in case this suffers by the same issues
as the loopback devices, and drops in-flight IO when we disassemble it.
Diffstat (limited to 'src')
-rw-r--r-- | src/shutdown/umount.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/shutdown/umount.c b/src/shutdown/umount.c index 4354485728..89b05fcc3f 100644 --- a/src/shutdown/umount.c +++ b/src/shutdown/umount.c @@ -484,6 +484,9 @@ static int delete_md(MountPoint *m) { if (fd < 0) return -errno; + if (fsync(fd) < 0) + log_debug_errno(errno, "Failed to sync MD block device %s, ignoring: %m", m->path); + if (ioctl(fd, STOP_ARRAY, NULL) < 0) return -errno; |