multipath-tools/0011-bugfix-flush-and-sync-before-reboot.patch

20 lines
321 B
Diff
Raw Normal View History

2020-01-10 17:13:17 +08:00
--- a/libmultipath/util.c
+++ b/libmultipath/util.c
2020-11-04 21:19:44 +08:00
@@ -368,6 +368,13 @@ int safe_write(int fd, const void *buf, size_t count)
2020-01-10 17:13:17 +08:00
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;
}
2020-11-04 21:19:44 +08:00
--
1.8.3.1