From 37fd0f145e2410f7a8091e58804dccad43b04afd Mon Sep 17 00:00:00 2001 From: "John L. Hammond" Date: Thu, 17 Sep 2020 15:56:55 -0500 Subject: [PATCH] LU-14051 utils: flush alr batch file in thread In ofd_access_log_reader, move flushing of the batch file thread to the sort and print thread. Test-Parameters: trivial Signed-off-by: John L. Hammond Change-Id: Id1e008ede6c05e24ea2e2459520d6585007acc7d Reviewed-on: https://review.whamcloud.com/40310 Tested-by: Maloo Tested-by: jenkins Reviewed-by: Alex Zhuravlev Reviewed-by: Jian Yu Reviewed-by: Oleg Drokin --- lustre/utils/ofd_access_batch.c | 2 ++ lustre/utils/ofd_access_log_reader.c | 8 -------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/lustre/utils/ofd_access_batch.c b/lustre/utils/ofd_access_batch.c index c5b4180..75cd43e 100644 --- a/lustre/utils/ofd_access_batch.c +++ b/lustre/utils/ofd_access_batch.c @@ -433,6 +433,8 @@ void *alr_sort_and_print_thread(void *arg) } out: + fflush(aa->file); + list_for_each_entry_safe(alre, next, tmp, alre_fid_hash_node.fhn_node) { alre_del_init(alre); free(alre); diff --git a/lustre/utils/ofd_access_log_reader.c b/lustre/utils/ofd_access_log_reader.c index 5bbc20a..44986f6 100644 --- a/lustre/utils/ofd_access_log_reader.c +++ b/lustre/utils/ofd_access_log_reader.c @@ -508,14 +508,6 @@ static int alr_batch_timer_io(int epoll_fd, struct alr_dev *td, unsigned int mas alr_batch_file_path, strerror(errno)); goto out; } - - /* FIXME: blocking write to batch file. */ - rc = fflush(alr_batch_file); - if (rc < 0) { - ERROR("cannot write to '%s': %s\n", - alr_batch_file_path, strerror(errno)); - goto out; - } out: /* Failed writes will leave alr_batch_file (pipe) in a * weird state so make that fatal. */ -- 1.8.3.1