On Wed 18-07-18 13:40:07, Jan Kara wrote:
On Wed 18-07-18 11:20:15, Johannes Thumshirn wrote:
quoted
On Wed, Jul 18, 2018 at 03:54:46PM +0800, Ming Lei wrote:
quoted
Please go ahead and take care of it since you have the test cases.
Speaking of which, do we already know how it is triggered and can we
cook up a blktests testcase for it? This would be more than helpful
for all parties.
Using multiple iovecs with writev / readv trivially triggers the case of IO
that is done partly as direct and partly as buffered. Neither me nor Martin
were able to trigger the data corruption the customer is seeing with KVM
though (since the generic code tries to maintain data integrity even if the
IO is mixed). It should be possible to trigger the corruption by having two
processes doing write to the same PAGE_SIZE region of a block device, just at
different offsets. And if the first process happens to use direct IO while
the second ends up doing read-modify-write cycle through page cache, the
first write could end up being lost. I'll try whether something like this
is able to see the corruption...
OK, when I run attached test program like:
blkdev-dio-test /dev/loop0 0 &
blkdev-dio-test /dev/loop0 2048 &
One of them reports lost write almost immediately. On kernel with my fix
the test program runs for quite a while without problems.
Honza
--
Jan Kara [off-list ref]
SUSE Labs, CR