multipath-tools/0011-bugfix-flush-and-sync-before-reboot.patch
2021-02-01 20:29:41 +08:00

20 lines
321 B
Diff

--- a/libmultipath/util.c
+++ b/libmultipath/util.c
@@ -368,6 +368,13 @@ int safe_write(int fd, const void *buf, size_t count)
count -= r;
buf = (const char *)buf + r;
}
+
+ /* sync->disk */
+ if (fsync(fd) < 0) {
+ condlog(0, "failed to fsync fd :%d", fd);
+ return -errno;
+ }
+
return 0;
}
--
1.8.3.1