logwrites: warn if we don't think read after discard returns zeroes
The logwrites replay program expects that it can issue a DISCARD against
the block device passed to _log_writes_init and that will cause all
subsequent reads to return zeroes. This is required for correct log
recovery on filesystems such as XFS that skip recovering buffers if
newer ones are found on disk.
Unfortunately, there's no way to discover if a device's discard
implementation actually guarantees zeroes. There used to be a sysfs
knob keyed to an allowlist, but it is now hardwired to return 0. So
either we need a magic device that does discard-and-zero, or we need to
do the zeroing ourselves. The logwrites program does its own zeroing if
there is no discard support, and some tests do their own zeroing.
The only devices we know to work reliably are the software defined ones
that are provided by the kernel itself -- which means dm-thinp. Warn if
we have a device that supports discard that isn't thinp and the test
fails.
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>