Comment 2 for bug 701678

Revision history for this message
Guilherme Salgado (salgado) wrote :

The issue here is that we have some code which ensures a given partition is mounted before we run mkfs on it. We do that because sometimes the automounter may kick in right after we've changed the partition table of the device and mount the partition before we have a chance to run mkfs on it.

The 'udevadm settle' trick didn't work, but Martin Pitt suggested we listen to udisks events about the new partition and only ensure it's unmounted after the event is fired. Another alternative would be to run 'sudo udisks --inhibit' while lmc runs.

However, this race condition is specifically related to the loopback devices that are setup so that we can copy the bootfs/rootfs to the image file and (AFAICT) the automounter never does anything with loopback devices so I think we can just run mkfs on them without having to worry about whether or not they're mounted.