mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
d5425f4db9
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>