Paolo Bonzini 97a2ae3453 raw-posix: add support for write_zeroes on XFS and block devices
The code is similar to the implementation of discard and write_zeroes
with UNMAP.  However, failure must be propagated up to block.c.

The stale page cache problem can be reproduced as follows:

    # modprobe scsi-debug lbpws=1 lbprz=1
    # ./qemu-io /dev/sdXX
    qemu-io> write -P 0xcc 0 2M
    qemu-io> write -z 0 1M
    qemu-io> read -P 0x00 0 512
    Pattern verification failed at offset 0, 512 bytes
    qemu-io> read -v 0 512
    00000000:  cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc  ................
    ...

    # ./qemu-io --cache=none /dev/sdXX
    qemu-io> write -P 0xcc 0 2M
    qemu-io> write -z 0 1M
    qemu-io> read -P 0x00 0 512
    qemu-io> read -v 0 512
    00000000:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    ...

And similarly with discard instead of "write -z".

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-12-03 15:26:49 +01:00
..
2013-10-11 16:50:00 +02:00
2013-09-12 10:12:47 +02:00
2013-09-12 10:12:47 +02:00
2013-10-11 10:52:54 +02:00
2013-09-12 10:12:47 +02:00
2013-09-12 10:12:47 +02:00
2013-08-19 15:52:19 +02:00
2013-11-29 13:40:33 +01:00
2013-09-12 10:12:47 +02:00
2013-11-29 13:40:36 +01:00
2013-09-12 10:12:48 +02:00
2013-11-07 13:58:59 +01:00