ext4/021: make sure the fdatasync subprocess exits
PATCH 1/1 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 kill and wait the xfs_io fdatasync subprocess to make sure _check_scratch_fs success.
--- tests/ext4/021 | 1 + 1 file changed, 1 insertion(+)
tests/ext4/021 +1 -0
@@ -18,6 +18,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { + $KILLALL_PROG -wq xfs_io cd / rm -f $tmp.* }
Signature · 1 line
2.23.0.rc2.8.gff66981f45
Quoted 10 lines · zhangyi (F)
Now we just kill
fdatasync_workprocess 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/sdbalready mounted on/tmp/scratch. !!! failed to remount/dev/sdbon/tmp/scratchThis patch kill and wait the
xfs_iofdatasync subprocess to make sure_check_scratch_fssuccess.
Yeah, that's a problem.
I think you could add another "trap" in fdatasync_work, as what btrfs/036 does:
trap "wait; exit" SIGTERM
So xfs_io will be waited by fdatasync_work before exiting.
Thanks,
Eryu
Quoted 21 lines
Signed-off-by zhangyi (F) <[email protected]>--- tests/ext4/021 | 1 + 1 file changed, 1 insertion(+)tests/ext4/021 +1
-0@@ -18,6 +18,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { + $KILLALL_PROG -wq xfs_io cd / rm -f $tmp.* }Signature · 1 line
2.23.0.rc2.8.gff66981f45
Hi,
Quoted 12 lines · Eryu Guan
Quoted 10 lines · zhangyi (F)
Now we just kill
fdatasync_workprocess 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/sdbalready mounted on/tmp/scratch. !!! failed to remount/dev/sdbon/tmp/scratchThis patch kill and wait the
xfs_iofdatasync subprocess to make sure_check_scratch_fssuccess.
Quoted 9 lines
Yeah, that's a problem.
I think you could add another "trap" in
fdatasync_work, as what btrfs/036 does:trap "wait; exit" SIGTERM
So
xfs_iowill be waited byfdatasync_workbefore exiting.
Thanks for your suggestion, I will do that.
Thanks,
Yi.