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>
This commit is contained in:
Dave Chinner
2015-05-04 16:47:52 +10:00
committed by Dave Chinner
parent facff609af
commit d5425f4db9
2 changed files with 23 additions and 12 deletions
-1
View File
@@ -50,7 +50,6 @@ _supported_os Linux
_require_test
_require_scratch_nocheck
_require_dm_snapshot
_require_block_device $SCRATCH_DEV
_require_command $LVM_PROG lvm
echo "Silence is golden"