mount: fix "mount -a" for auto-clear loopdevs and /proc/mounts
The "mount -a" uses /etc/mtab to detect already mounted file systems
from /etc/fstab -- this check requires the same FS name (1st field)
in fstab and mtab.
On systems with enabled auto-clear loop devies or systems without
regular mtab (symlink to /proc/mounts) there is /dev/loopN rather
than image filename in mtab. For example:
fstab:
/mnt/store/foo.ISO /mnt/image auto defaults 0 0
mtab:
/dev/loop0 /mnt/image iso9960 rw 0 0
We have to scan all available loop devices to check if some of the
devices is not associated with the image file from fstab.
Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=618957 Signed-off-by: Karel Zak <kzak@redhat.com>