rbd rounds off and ignores discards that are smaller than alloc_size,
but the page cache is invalidated according to the original offset and
length, before calling into the driver. For a 512~4193792 discard, all
pages except for the first will be invalidated, but the first page may
remain cached after being partially zeroed out. This results in an
inconsistency when alloc_size != 512. E.g. for 64k:
0 512 4k 64k 4M
| | | | |
page cache: xxxxxxxx00000000xxxxxxxx0000000000000000
RADOS: xxxxxxxxxxxxxxxxxxxxxxxx0000000000000000
Given that these tests asserts on-disk state, we need to read directly
from disk. krbd_discard_512b.t and krbd_zeroout.t are fine -- there is
no rounding there.
Fixes: https://tracker.ceph.com/issues/41753
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>