From: Lennart Poettering Date: Tue, 22 Sep 2020 09:21:27 +0000 (+0200) Subject: shutdown: also fsync() MD devices when going down X-Git-Tag: v247-rc1~182^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=32c4626c4c34a7deb9ddc5edfba98c3f171900c8;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/shutdown/umount.c b/src/shutdown/umount.c index 43544857283..89b05fcc3fb 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;