Unlike logs from regular writers, logs from stdio writers are not
contained in a single write_iter call: if the last character written in
the call is not a newline, some of the input remains in the buffer for
the next write_iter call. This means that some data might remain in the
buffer during release, and such data has to be flushed; otherwise, it
would be lost.
Change-Id: I13c9dc020967fe8ef3fbcd52d45f85b8725d3c2c
Signed-off-by: Mateusz Majewski <m.majewski2@samsung.com>
/*
* logger_release - the log's release file operation
- *
- * Note this is a total no-op in the write-only case. Keep it that way!
*/
static int logger_release(struct inode *ignored, struct file *file)
{
} else {
struct logger_writer *writer = file->private_data;
+ bool from_stdio = writer->tag && writer->prio >= 2;
+ if (from_stdio && writer->b_off > 0)
+ flush_thread_data(file);
+
kfree(writer->tag);
kfree(writer->buffer);
kfree(writer);