On Wed, Jun 12, 2019 at 10:11:31PM +0800, Qu Wenruo wrote:
> On 2019/6/12 下午9:51, Tomasz Kłoczko wrote:
> > [TEST/fsck] 037-freespacetree-repair
> > failed: root_helper umount
> > /home/tkloczko/rpmbuild/BUILD/btrfs-progs-v5.1.1/tests//test.img
> > test failed for case 037-freespacetree-repair
> > make: *** [Makefile:352: test-fsck] Error 1
> > error: Bad exit status from /var/tmp/rpm-tmp.3DQ01g (%check)
> >
> > In log line I found:
> >
> > ====== RUN CHECK root_helper mount -t btrfs -o loop
> > /home/tkloczko/rpmbuild/BUILD/btrfs-progs-v5.1.1/tests//test.img
> > /home/tkloczko/rpmbuild/BUILD/btrfs-progs-v5.1.1/tests//mnt
> > ====== RUN CHECK root_helper fallocate -l 50m
> > /home/tkloczko/rpmbuild/BUILD/btrfs-progs-v5.1.1/tests//mnt/file
> > ====== RUN CHECK root_helper umount
> > /home/tkloczko/rpmbuild/BUILD/btrfs-progs-v5.1.1/tests//test.img
> > umount: /home/tkloczko/rpmbuild/BUILD/btrfs-progs-v5.1.1/tests/mnt:
> > target is busy.
> > failed: root_helper umount
> > /home/tkloczko/rpmbuild/BUILD/btrfs-progs-v5.1.1/tests//test.img
> >
> > After test suite fails I'm able to umount it manually.
> >
> > [tkloczko@domek tests]$ sudo umount
> > /home/tkloczko/rpmbuild/BUILD/btrfs-progs-v5.1.1/tests//test.img
> > [tkloczko@domek tests]$
> >
> > So looks like during umount still something is holding umount.
>
> Similar situation here, but if you're using DE or things like udisk,
> it's mostly such tools affecting the umount.
>
> For me, inside a minimal VM, without all the GUI things listening on
> mounted locations, 037 will pass without problem.
I'm running the tests on my desktop with a DE and the test passes every
time.
Tomas, can you please run the tests with the following diff:
--- a/tests/common
+++ b/tests/common
@@ -512,7 +512,10 @@ run_check_umount_test_dev()
if [ "$#" = 0 ]; then
set -- "$TEST_DEV"
fi
- run_check $SUDO_HELPER umount "$@"
+ if ! run_mayfail $SUDO_HELPER umount "$@"; then
+ run_check $SUDO_HELPER lsof "$TEST_MNT"
+ _fail "umount on $TEST_MNT failed"
+ fi
}
---
This should dump all potential holders of the mount path when the umount
fails. I've tested here by cd'ing into the mount directory right after
the test starts and get something like this in the results:
====== RUN CHECK root_helper fallocate -l 4k .../btrfs-progs/tests//mnt/file.2779
====== RUN CHECK root_helper fallocate -l 4k .../btrfs-progs/tests//mnt/file.2319
====== RUN MAYFAIL root_helper umount .../btrfs-progs/tests//test.img
umount: .../btrfs-progs/tests/mnt: target is busy.
failed (ignored, ret=32): root_helper umount .../btrfs-progs/tests//test.img
====== RUN CHECK root_helper lsof .../btrfs-progs/tests//mnt
bash 7777 dsterba cwd DIR 0,68 51840 256 .../btrfs-progs/tests//mnt
umount on .../btrfs-progs/tests//mnt failed
test failed for case 037-freespacetree-repair
As a workaround, a short delay, sync and repeated umount can be done in
the umount helper so the test is more reliable, but first I'd like to
know what's causing the problems.