[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 09/11] raw-posix: implement write_zeroes with MA
From: |
Peter Lieven |
Subject: |
Re: [Qemu-devel] [PATCH 09/11] raw-posix: implement write_zeroes with MAY_UNMAP for block devices |
Date: |
Wed, 13 Nov 2013 15:45:45 +0100 |
> Am 13.11.2013 um 15:39 schrieb Paolo Bonzini <address@hidden>:
>
> Il 13/11/2013 15:14, Peter Lieven ha scritto:
>>>>>> does BLKDISCARDZEROES ioctl guarantee that a device is
>>>>>> zero initialized or does it just guarantee that a discard may not
>>>>>> fail and that it reads as zeroes afterwards?
>>>>
>>>> Only the latter. ".bdrv_has_zero_init" is only present in the bdrv_file
>>>> BlockDriver.
>> Then bdi->unallocated_blocks_are_zero must stay 0. .bdrv_has_zero_init's
>> semantic is to reflect the zero status of all blocks of the device right
>> after bdrv_create
>> independently of their allocation status. bdi->unallocated_blocks_are_zero
>> reflects the zero status of every unallocated block regardless if it was
>> unallocated right from the beginning or became unallocated through a discard.
>
> What we have is:
>
> * bdi->unallocated_blocks_are_zero returns true
>
> * bdrv_create doesn't ensure that every block starts unallocated
>
> * hence bdrv_has_zero_init returns false
>
> Blocks that (for any reason) are unallocated after bdrv_create *will* be
> zero if BLKDISCARDZEROES returns true.
Ok, then i misunderstood your comment. If BLKDISCARDZEROES means lbprz == 1
SCSI speaking then you are right.
Peter
>
> Paolo
- [Qemu-devel] [PATCH 07/11] block: handle ENOTSUP from discard in generic code, (continued)
- [Qemu-devel] [PATCH 07/11] block: handle ENOTSUP from discard in generic code, Paolo Bonzini, 2013/11/12
- [Qemu-devel] [PATCH 08/11] raw-posix: implement write_zeroes with MAY_UNMAP for files, Paolo Bonzini, 2013/11/12
- [Qemu-devel] [PATCH 10/11] raw-posix: add support for write_zeroes on XFS and block devices, Paolo Bonzini, 2013/11/12
- [Qemu-devel] [PATCH 09/11] raw-posix: implement write_zeroes with MAY_UNMAP for block devices, Paolo Bonzini, 2013/11/12
- [Qemu-devel] [PATCH 11/11] qemu-iotests: 033 is fast, Paolo Bonzini, 2013/11/12
- [Qemu-devel] [PATCH 05/11] scsi-disk: reject ANCHOR=1 for UNMAP and WRITE SAME commands, Paolo Bonzini, 2013/11/12