]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commit
xfs/049: umount -d fails when kernel wins teardown race
authorDave Chinner <dchinner@redhat.com>
Wed, 18 Mar 2015 03:54:44 +0000 (14:54 +1100)
committerDave Chinner <david@fromorbit.com>
Wed, 18 Mar 2015 03:54:44 +0000 (14:54 +1100)
commitee6ad7f578f29da0a0f5eab1573710194ce1dbdf
treee454a07ab81ebe9bf498110482cb6b107480615b
parent354108ebb9a8d11b6c57d9e63fc16cd86ccc2e43
xfs/049: umount -d fails when kernel wins teardown race

When /etc/mtab is linked to /proc/mounts and we are using mount time
created loop devices (i.e. mount -o loop), the unmount can fail
with this amazingly informative error message:

umount: /mnt/scratch/test2: filesystem was unmounted, but mount(8) failed: Invalid argument

What it actually means in this case is that the kernel tore down the
loop device when the last reference went away, and it did it so fast
that mount was not able to find it in /etc/mtab after the unmount
syscall. Hence it could not find the loop device it was supposed to
tear down and has a hissy fit.

This is simple to fix: mount does not need to tear down the loop
device as the kernel does it automatically. Remove the "-d" from
the umount command, and the test passes again.

There's quite a few other tests that also use umount -d - fix them
as well.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
tests/xfs/049
tests/xfs/073
tests/xfs/078
tests/xfs/216
tests/xfs/217
tests/xfs/250