summaryrefslogtreecommitdiff
path: root/src/shutdown/umount.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2020-09-22 11:21:27 +0200
committerLennart Poettering <lennart@poettering.net>2020-09-23 18:33:48 +0200
commit32c4626c4c34a7deb9ddc5edfba98c3f171900c8 (patch)
tree56c870343d831112ef6390d3222fa8ef60b389a9 /src/shutdown/umount.c
parent1a269c4ee34a4fc98f2407996cc6bda82f3e03bf (diff)
downloadsystemd-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/shutdown/umount.c')
-rw-r--r--src/shutdown/umount.c3
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;