[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 13/20] block/iscsi: use UNMAP to write zeroes
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH v2 13/20] block/iscsi: use UNMAP to write zeroes if LBPRZ=1 |
Date: |
Thu, 21 Nov 2013 12:49:19 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130923 Thunderbird/17.0.9 |
Il 21/11/2013 12:43, Peter Lieven ha scritto:
>>
>> @@ -1579,7 +1582,7 @@ static int iscsi_get_info(BlockDriverState
>> *bs, BlockDriverInfo *bdi)
>> {
>> IscsiLun *iscsilun = bs->opaque;
>> bdi->unallocated_blocks_are_zero = !!iscsilun->lbprz;
>> - bdi->can_write_zeroes_with_unmap = iscsilun->lbprz &&
>> iscsilun->lbp.lbpws;
>> + bdi->can_write_zeroes_with_unmap = !!iscsilun->lbprz;
>> return 0;
>> }
>>
> I would definetly not do that! I have seen at least my target to execute
> only parts of a discard request.
Does that target have LBPRZ and LBPU but not LBPWS? Note that I'm still
preferring WRITE SAME to UNMAP if both are available.
If so, then this patch is indeed problematic. Otherwise, it's just
making the same assumptions that Linux has been making forever.
> Additionally in our semantic a discard request may silently fail.
That doesn't matter, the silent failure is handled in block.c. Here I'm
calling iscsi_co_discard, not bdrv_co_discard. If it returns ENOTSUP,
it is passed up to bdrv_co_do_write_zeroes which will fall back to writes.
> In general this could lead to data corruption
> due to broken implementations.
A broken implementation could also have LBPWS=1 and execute only the
aligned parts of a WRITE SAME with UNMAP request.
Paolo
- [Qemu-devel] [PATCH v2 08/20] block drivers: add discard/write_zeroes properties to bdrv_get_info implementation, (continued)
- [Qemu-devel] [PATCH v2 10/20] block/iscsi: remove .bdrv_has_zero_init, Paolo Bonzini, 2013/11/19
- [Qemu-devel] [PATCH v2 09/20] block drivers: expose requirement for write same alignment from formats, Paolo Bonzini, 2013/11/19
- [Qemu-devel] [PATCH v2 11/20] block/iscsi: updated copyright, Paolo Bonzini, 2013/11/19
- [Qemu-devel] [PATCH v2 12/20] block/iscsi: check WRITE SAME support differently depending on MAY_UNMAP, Paolo Bonzini, 2013/11/19
- [Qemu-devel] [PATCH v2 13/20] block/iscsi: use UNMAP to write zeroes if LBPRZ=1, Paolo Bonzini, 2013/11/19
[Qemu-devel] [PATCH v2 14/20] raw-posix: implement write_zeroes with MAY_UNMAP for files, Paolo Bonzini, 2013/11/19
[Qemu-devel] [PATCH v2 15/20] raw-posix: implement write_zeroes with MAY_UNMAP for block devices, Paolo Bonzini, 2013/11/19
[Qemu-devel] [PATCH v2 16/20] raw-posix: add support for write_zeroes on XFS and block devices, Paolo Bonzini, 2013/11/19
[Qemu-devel] [PATCH v2 17/20] qemu-iotests: 033 is fast, Paolo Bonzini, 2013/11/19
[Qemu-devel] [PATCH v2 18/20] scsi-disk: catch write protection errors in UNMAP, Paolo Bonzini, 2013/11/19
[Qemu-devel] [PATCH v2 19/20] scsi-disk: reject ANCHOR=1 for UNMAP and WRITE SAME commands, Paolo Bonzini, 2013/11/19
[Qemu-devel] [PATCH v2 20/20] scsi-disk: correctly implement WRITE SAME, Paolo Bonzini, 2013/11/19