]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commit
generic: LVM and ram disks don't play well
authorDave Chinner <dchinner@redhat.com>
Mon, 4 May 2015 06:47:52 +0000 (16:47 +1000)
committerDave Chinner <david@fromorbit.com>
Mon, 4 May 2015 06:47:52 +0000 (16:47 +1000)
commitd5425f4db9cb66cd02b36da5336528426ff3ffc7
tree43615766e2a4feeb0c1aa9a6e1b11b49aaa37d72
parentfacff609afd6a2ca557c2b679e088982026aa188
generic: LVM and ram disks don't play well

The "brd" kernel ram disk abuses BLKFLSBUF to mean "free all memory
in the ram drive" when in fact it should mean "flush all dirty
buffers to stable storage". The brd driver ignores BLKFLSBUF if
there is an active reference to the block device, (e.g. a fs is
mounted on it), but when a device is layered over the top of it
(e.g. dm-flakey, lvm devices, etc) then the applications and
filesystems hold references to the upper device, not the brd device.
Hence when the upper device passes down BLKFLSBUF to brd, it removes
all the pages in the brd, effectively erasing it.  This causes all
sorts of problems.....

Fix this by black listing "/dev/ramXXX" devices from tests that
require DM in some way. The _requires_sane_bdev_flush() macro is
called by the _requires_dm.... checks so that we don't have to
remember to add this to all new tests that use dm in some way.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
common/rc
tests/generic/081