Loop device partition scanning is unreliable

From: Daniel Drake
Date: Thu Jul 19 2012 - 11:42:37 EST


Hi,

I'm having trouble with the loop device partition scanning code.

If I create a blank file, put a partition table on it with fdisk, and
then immediately turn it into a partitioned loop device, the
partitions dont always show up.

Here is a script to test this:
http://dev.laptop.org/~dsd/20120719/loop-partition.sh

I have reproduced this on 5 systems, a mixture of 32 and 64 bit. It
doesn't seem to matter if the underlying filesystem is ext4 or tmpfs.
I've reproduced it on 3.3, 3.4.5 and 3.5-rc7.

On some systems it seems to always fail within 8 loops. On others it
takes more time (100+ loops). I think it crashes more reliable when
the system is under load - I'm testing with stress
(http://weather.ou.edu/~apw/projects/stress/): stress -c 6 -m 6 -d 1

Any thoughts?

Thanks,
Daniel
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/