btrfs/232: fix umount failure due to fsstress still running
authorFilipe Manana <fdmanana@suse.com>
Thu, 18 Mar 2021 11:48:15 +0000 (11:48 +0000)
committerEryu Guan <guaneryu@gmail.com>
Sun, 21 Mar 2021 13:13:30 +0000 (21:13 +0800)
commit7c476f1890c5d44f21a42836db573e5703a6e1cd
tree7a6beeaed22038ae6f9a3f334b58baf0c52cb95d
parent3d15d3fe85f91f44b29f74f1effd4f714e5a0de2
btrfs/232: fix umount failure due to fsstress still running

We start a process that runs fsstress, then kill the process, wait for it
to die and then end the test, where we attempt to unmount the fs which
often fails because the fsstress subcommand started by the process is
still running and using the mount point. This results in a test failure:

  btrfs/232 1s ... umount: /home/fdmanana/btrfs-tests/scratch_1: target is busy.
  _check_btrfs_filesystem: filesystem on /dev/sdc is inconsistent
  (see /home/fdmanana/git/hub/xfstests/results//btrfs/232.full for details)

Fix that by adding a trap to the writer() function.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
tests/btrfs/232