----- Original Message ----- > Hi! > > NOTE: It's wise NOT to use safe macros in test cleanup(). This is because > > all safe macros call tst_brkm(), which exits the test immediately, > > making the cleanup() exit prematurely. (Actually, this is hacked > > around in > > the test library at the moment so that the cleanup() will finish, but > > the hack will be removed in the future). > > > > Signed-off-by: Li Wang <li...@redhat.com> > > --- > > testcases/kernel/mem/thp/thp05.c | 69 > > ++++++++++++++++++++++++++++++++-------- > > 1 file changed, 56 insertions(+), 13 deletions(-) ... > > While generally avoiding the safe macros in cleanup is fine, in this > case you have replaced about ten lines of code with about hundred lines > of copy & pasted code and even the coding style is wrong.
Okay, this is my second time to format patch to upstream, so sorry for my bad coding style. > > What should be done in this case is to create an equivalent to the > SAFE_FILE_PRINTF() function that is not calling the tst_brkm() and well, if create a new safe function/macro to replace use the SAFE_FILE_PRINTF but not calling tst_brkm(), that's will be break the safe rule. if create a unsafe function/macro, I dont know where is to place the new function and how to rename. Additional, i found so much testcases use safe macro in there cleanup(), that's really a hard work if maintain all. > issues only a warning. Or modify SAFE_FILE_PRINTF() to have additional > parameter that selects if on failure tst_brkm() or tst_resm(TWARN, ...) as above reason, if modify the safe macro not calling tet_brkm(), that would not be safe for LTP any more. anyway, I am trying on a solution... --- Regards Li Wang > is called. > > -- > Cyril Hrubis > chru...@suse.cz > > ------------------------------------------------------------------------------ > _______________________________________________ > Ltp-list mailing list > Ltp-list@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/ltp-list > ------------------------------------------------------------------------------ _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list