linux-test-project / ltp

Linux Test Project (mailing list: https://lists.linux.it/listinfo/ltp)
https://linux-test-project.readthedocs.io/
GNU General Public License v2.0
2.28k stars 999 forks source link

Fix the problem of repeated printing logs when the dio module specifies the output log file #1049

Closed LinuxVWQH closed 12 months ago

LinuxVWQH commented 1 year ago

1.Fix the problem of repeated printing logs when the dio module specifies the output log file,This is a typetical buffer problem.The author did not realized the buffer copy when user appointed the output log file, The diotest6/diotes3 was designed third steps whole programe,every step will fork lots of process,If the cache subprocess is not cleaned up, the cache generated in the previous step will be copied, and then when each process exits, a large number of repeated prints will be generated. 2.According to the above description of the problem, SO before each fork, we should do fflush the buffer.

Signed-off-by: Duncan.chu wqhaicyj@163.com

metan-ucw commented 1 year ago

The actual code change looks good, but the commit message is not.

First of all the commit message should be self contained, it should describe that these tests did not flush open streams before forking which may result into duplicated messages as these end up being printed by both the parent and the children.

Also I do not see where Ritchie or Peter added their Reviewed-by: tags and the email from Ritchie is misspelled. You can only add your Signed-off-by to the patch if it wasn't reviewed yet.