Comment 5 for bug 1765653

Revision history for this message
Manoj Iyer (manjo) wrote :

This is a test case issue, and the failure is a false positive. ecryptfs/tests/kernel/directory-concurrent/test.c hang_check() the parent uses select() to check to see if the child process has completed. The child process lets the parent know that its done by writing "EXIT" to a pipe. select() is non blocking while read() is blocking, so the select() would timeout after 30s if nothing was read from the pipe, this timeout state is used to detect a hang in rmdir/mkdir. But the test does not take into account of the fact that there is no guarantee that the the order of execution after a fork() will be child first and then parent. If the parent executes before the child, we hit these false positives.

The sync between parent and child can be achieved by calling wait(NULL) before select(), ie let the parent wait for the child state to change, but if there really is a hang in rmdir/mkdir the parent would hang indefinitely, and that would defeat the tests purpose of detecting hangs.

I found that as a workaround, adding a sleep(1) after write() in the child helps with resolving this issue. I tested this multiple times successfully.