[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 07/11] block/iscsi: allow fall back to WRITE SAME wit
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 07/11] block/iscsi: allow fall back to WRITE SAME without UNMAP |
Date: |
Fri, 16 May 2014 12:37:40 +0200 |
From: Peter Lieven <address@hidden>
if the iscsi driver receives a write zeroes request with
the BDRV_REQ_MAY_UNMAP flag set it fails with -ENOTSUP
if the iscsi target does not support WRITE SAME with
UNMAP. However, the BDRV_REQ_MAY_UNMAP is only a hint
and writing zeroes with WRITE SAME will still be
better than falling back to writing zeroes with WRITE16.
Signed-off-by: Peter Lieven <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
block/iscsi.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/block/iscsi.c b/block/iscsi.c
index a636ea4..56f5419 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -809,13 +809,14 @@ coroutine_fn iscsi_co_write_zeroes(BlockDriverState *bs,
int64_t sector_num,
return -EINVAL;
}
- if (!(flags & BDRV_REQ_MAY_UNMAP) && !iscsilun->has_write_same) {
- /* WRITE SAME without UNMAP is not supported by the target */
- return -ENOTSUP;
+ if ((flags & BDRV_REQ_MAY_UNMAP) && !iscsilun->lbp.lbpws) {
+ /* WRITE SAME with UNMAP is not supported by the target,
+ * fall back and try WRITE SAME without UNMAP */
+ flags &= ~BDRV_REQ_MAY_UNMAP;
}
- if ((flags & BDRV_REQ_MAY_UNMAP) && !iscsilun->lbp.lbpws) {
- /* WRITE SAME with UNMAP is not supported by the target */
+ if (!(flags & BDRV_REQ_MAY_UNMAP) && !iscsilun->has_write_same) {
+ /* WRITE SAME without UNMAP is not supported by the target */
return -ENOTSUP;
}
--
1.8.3.1
- [Qemu-devel] [PULL 00/11] SCSI changes for 2014-05-15, Paolo Bonzini, 2014/05/16
- [Qemu-devel] [PULL 03/11] megasas: Implement LD_LIST_QUERY, Paolo Bonzini, 2014/05/16
- [Qemu-devel] [PULL 01/11] scsi-disk: Improve error messager if can't get version number, Paolo Bonzini, 2014/05/16
- [Qemu-devel] [PULL 04/11] megasas: Enable MSI-X support, Paolo Bonzini, 2014/05/16
- [Qemu-devel] [PULL 05/11] megasas: Add MSI support, Paolo Bonzini, 2014/05/16
- [Qemu-devel] [PULL 02/11] scsi: Improve error messages more, Paolo Bonzini, 2014/05/16
- [Qemu-devel] [PULL 06/11] MAINTAINERS: mark megasas as maintained, Paolo Bonzini, 2014/05/16
- [Qemu-devel] [PULL 07/11] block/iscsi: allow fall back to WRITE SAME without UNMAP,
Paolo Bonzini <=
- [Qemu-devel] [PULL 08/11] block/iscsi: speed up read for unallocated sectors, Paolo Bonzini, 2014/05/16
- [Qemu-devel] [PULL 09/11] block/iscsi: clarify the meaning of ISCSI_CHECKALLOC_THRES, Paolo Bonzini, 2014/05/16
- [Qemu-devel] [PULL 10/11] block/iscsi: allow cluster_size of 4K and greater, Paolo Bonzini, 2014/05/16
- [Qemu-devel] [PULL 11/11] [PATCH] block/iscsi: bump year in copyright notice, Paolo Bonzini, 2014/05/16
- Re: [Qemu-devel] [PULL 00/11] SCSI changes for 2014-05-15, Peter Maydell, 2014/05/19