Data needs to be locked, otherwise resulting fdata file may be incorrect. Signed-off-by: Jan Friesse <jfriesse@redhat.com> Reviewed-by: Steven Dake <sdake@redhat.com> (cherry picked from commit c5e823732504e0c6e9e0eb66870bcacafde080c9)
@@ -1593,6 +1593,8 @@ int logsys_log_rec_store (const char *filename)
return (-1);
}
+ logsys_flt_lock();
+
this_write_size = write (fd, &flt_data_size, sizeof(uint32_t));
if (this_write_size != sizeof(unsigned int)) {
goto error_exit;
@@ -1619,10 +1621,12 @@ int logsys_log_rec_store (const char *filename)
+ logsys_flt_unlock();
close (fd);
return (0);
error_exit: