[vdsm] Test failure not free loop devices

Zhou Zheng Sheng zhshzhou at linux.vnet.ibm.com
Mon Aug 12 02:13:26 UTC 2013


Hi David,

on 2013-08-09 21:45, David Caro Estevez wrote:
> Sometimes we get this error when running the vdsm tests:
> 
> ======================================================================
> ERROR: testLoopMount (mountTests.MountTests)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "/ephemeral0/vdsm_unit_tests_gerrit_el/tests/mountTests.py", line 69, in testLoopMount
>     m.mount(mntOpts="loop")
>   File "/ephemeral0/vdsm_unit_tests_gerrit_el/vdsm/storage/mount.py", line 222, in mount
>     return self._runcmd(cmd, timeout)
>   File "/ephemeral0/vdsm_unit_tests_gerrit_el/vdsm/storage/mount.py", line 238, in _runcmd
>     raise MountError(rc, ";".join((out, err)))
> MountError: (2, ';mount: could not find any free loop device\n')
> -------------------- >> begin captured logging << --------------------
> Storage.Misc.excCmd: DEBUG: '/sbin/mkfs.ext2 -F /tmp/tmpq95svr' (cwd None)
> Storage.Misc.excCmd: DEBUG: SUCCESS: <err> = 'mke2fs 1.41.12 (17-May-2010)\n'; <rc> = 0
> Storage.Misc.excCmd: DEBUG: '/usr/bin/sudo -n /bin/mount -o loop /tmp/tmpq95svr /tmp/tmpcS29EU' (cwd None)
> 
> The problem is that it seems that the loop devices that are not being released (maybe when the test fails?) and the system runs out of devices eventually.
> Can you take a look to see where the cleanup fails and fix it?
> 

I think this may be related to a known bug [1] of gvfs.

To workaround the bug,
1. Reboot Linux
2. See if "ps aux | grep gvfs" produces any results, then kill all gvfs
related processes.
3. "cd tests", and run the tests "./run_tests_local.sh mkimageTests.py
mountTests.py" for 10 times, and "losetup -a" should give empty result
after each run. When gvfs is running, "losetup -a" would show 2 new loop
devices are occupied after each run.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=853674#c5
Thanks and best regards!

Zhou Zheng Sheng / 周征晟
E-mail: zhshzhou at linux.vnet.ibm.com
Telephone: 86-10-82454397



More information about the vdsm-devel mailing list