generic/032: fix failure due to attempt to wait for non-child process
Running generic/032 can sporadically fail like this:
generic/032 11s ... - output mismatch (see /home/fdmanana/git/hub/xfstests/results//generic/032.out.bad)
--- tests/generic/032.out 2023-03-02 21:47:53.
884609618 +0000
+++ /home/fdmanana/git/hub/xfstests/results//generic/032.out.bad 2025-05-28 10:39:34.
549499493 +0100
@@ -1,5 +1,6 @@
QA output created by 032
100 iterations
+/home/fdmanana/git/hub/xfstests/tests/generic/032: line 90: wait: pid
3708239 is not a child of this shell
000000 cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd >................<
*
100000
...
(Run 'diff -u /home/fdmanana/git/hub/xfstests/tests/generic/032.out /home/fdmanana/git/h
This is because we are attempting to wait for a process that is not a
child process of the test process and it's instead a child of a process
spawned by the test.
To make sure that after we kill the process running _syncloop() there
isn't any xfs_io process still running syncfs, add instead a trap to
to _syncloop() that waits for xfs_io to finish before the process running
that function exits.
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>