generic/446: make sure all background processes are dead before umount
authorEryu Guan <eguan@redhat.com>
Tue, 25 Jul 2017 08:04:21 +0000 (16:04 +0800)
committerEryu Guan <eguan@redhat.com>
Fri, 28 Jul 2017 10:53:51 +0000 (18:53 +0800)
commit14d318429ebb487965cbbbe518898e8af58bb7c0
treeb9304ce31092298460bc3ba5e37fa961fdf1cfdf
parent606c652eee97bacfa2cafce70cede6a6e8ea725c
generic/446: make sure all background processes are dead before umount

The $dread_pid refers to the while-true-do loop, wait for $dread_pid
doesn't mean the xfs_io direct read process is already dead,
sometimes xfs_io process is still running and blocking
_scratch_unmount.

Fix it by making the direct read does a fixed number of loop and
break out the second mmap-fpunch loop if the first loop exits. At
this point we're sure that there's no unfinished background process
blocking the umount.

Reviewed-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
tests/generic/446