Skip to content

Commit fca5822

Browse files
committed
logging: remove unuseful fsync
the file is going to be removed few lines later with rename(): ``` /* Replace the previous file */ if (rename(k8s_log_path_tmp, k8s_log_path) < 0) { pexit("Failed to rename log file"); } ``` so there is no point in the expensive sync call since the file is not supposed to be persisted after a reboot. Signed-off-by: Giuseppe Scrivano <[email protected]>
1 parent 1578849 commit fca5822

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

src/ctr_logging.c

-5
Original file line numberDiff line numberDiff line change
@@ -606,11 +606,6 @@ static void reopen_k8s_file(void)
606606

607607
_cleanup_free_ char *k8s_log_path_tmp = g_strdup_printf("%s.tmp", k8s_log_path);
608608

609-
/* Sync the logs to disk */
610-
if (!opt_no_sync_log && fsync(k8s_log_fd) < 0) {
611-
pwarn("Failed to sync log file on reopen");
612-
}
613-
614609
/* Close the current k8s_log_fd */
615610
close(k8s_log_fd);
616611

0 commit comments

Comments
 (0)