]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
shutdown: also fsync() MD devices when going down
authorLennart Poettering <lennart@poettering.net>
Tue, 22 Sep 2020 09:21:27 +0000 (11:21 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 23 Sep 2020 16:33:48 +0000 (18:33 +0200)
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.

src/shutdown/umount.c

index 4354485728363585211c42d66e74ce9c7b4453d8..89b05fcc3fbb1eb0bb914902f55871b63d859757 100644 (file)
@@ -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;