[igt-dev] [PATCH i-g-t] runner: Remember to sync journal.txt for all writes

Petri Latvala petri.latvala at intel.com
Wed Mar 25 13:19:43 UTC 2020


One missing fdatasync() for starting a subtest.

Fixes: https://gitlab.freedesktop.org/drm/igt-gpu-tools/issues/81
Signed-off-by: Petri Latvala <petri.latvala at intel.com>
Cc: Arkadiusz Hiler <arkadiusz.hiler at intel.com>
---
 runner/executor.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/runner/executor.c b/runner/executor.c
index c4b99115..d2ced797 100644
--- a/runner/executor.c
+++ b/runner/executor.c
@@ -868,6 +868,9 @@ static int monitor_output(pid_t child,
 				    !memcmp(outbuf, STARTING_SUBTEST, strlen(STARTING_SUBTEST))) {
 					write(outputs[_F_JOURNAL], outbuf + strlen(STARTING_SUBTEST),
 					      linelen - strlen(STARTING_SUBTEST));
+					if (settings->sync) {
+						fdatasync(outputs[_F_JOURNAL]);
+					}
 					memcpy(current_subtest, outbuf + strlen(STARTING_SUBTEST),
 					       linelen - strlen(STARTING_SUBTEST));
 					current_subtest[linelen - strlen(STARTING_SUBTEST)] = '\0';
-- 
2.20.1



More information about the igt-dev mailing list