mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
ext4/021: make sure the fdatasync subprocess exits
Now we just kill fdatasync_work process and wait nothing after the test, so a busy unmount failure may appear if the fdatasync syscall doesn't return in time. umount: /tmp/scratch: target is busy. mount: /tmp/scratch: /dev/sdb already mounted on /tmp/scratch. !!! failed to remount /dev/sdb on /tmp/scratch This patch waits the xfs_io fdatasync subprocess exit to make sure _check_scratch_fs success. Signed-off-by: zhangyi (F) <yi.zhang@huawei.com> Reviewed-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
This commit is contained in:
@@ -80,6 +80,10 @@ _scratch_mount
|
|||||||
|
|
||||||
do_fdatasync_work()
|
do_fdatasync_work()
|
||||||
{
|
{
|
||||||
|
# Wait for running subcommand before exitting so that
|
||||||
|
# mountpoint is not busy when we try to unmount it
|
||||||
|
trap "wait; exit" SIGTERM
|
||||||
|
|
||||||
while [ 1 ]; do
|
while [ 1 ]; do
|
||||||
$XFS_IO_PROG -f -c "fdatasync" $SCRATCH_MNT/testfile
|
$XFS_IO_PROG -f -c "fdatasync" $SCRATCH_MNT/testfile
|
||||||
done
|
done
|
||||||
@@ -89,6 +93,7 @@ do_fdatasync_work &
|
|||||||
datasync_work_pid=$!
|
datasync_work_pid=$!
|
||||||
sleep 10
|
sleep 10
|
||||||
kill $datasync_work_pid >/dev/null 2>&1
|
kill $datasync_work_pid >/dev/null 2>&1
|
||||||
|
wait
|
||||||
|
|
||||||
# success, all done
|
# success, all done
|
||||||
status=0
|
status=0
|
||||||
|
|||||||
Reference in New Issue
Block a user