|
|
9ae3a8 |
From 5ef7ecc30ffede5d4970165f471ae5d066488fcd Mon Sep 17 00:00:00 2001
|
|
|
9ae3a8 |
From: Fam Zheng <famz@redhat.com>
|
|
|
9ae3a8 |
Date: Fri, 4 Apr 2014 05:56:02 +0200
|
|
|
9ae3a8 |
Subject: [PATCH 07/12] iscsi: always query max WRITE SAME length
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
RH-Author: Fam Zheng <famz@redhat.com>
|
|
|
9ae3a8 |
Message-id: <1396590962-25815-8-git-send-email-famz@redhat.com>
|
|
|
9ae3a8 |
Patchwork-id: 58344
|
|
|
9ae3a8 |
O-Subject: [RHEL-7 0day qemu-kvm PATCH 7/7] iscsi: always query max WRITE SAME length
|
|
|
9ae3a8 |
Bugzilla: 1083413
|
|
|
9ae3a8 |
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Markus Armbruster <armbru@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Jeffrey Cody <jcody@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
From: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Max WRITE SAME length is also used when the UNMAP bit is zero, so it
|
|
|
9ae3a8 |
should be queried even if LBPWS=0. Same for the optimal transfer
|
|
|
9ae3a8 |
length.
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
However, the write_zeroes_alignment only matters for UNMAP=1 so we
|
|
|
9ae3a8 |
still restrict it to LBPWS=1.
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Reviewed-by: Peter Lieven <pl@kamp.de>
|
|
|
9ae3a8 |
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
9ae3a8 |
(cherry picked from commit c97ca29db0a68deb281a901f535cec5ea4862244)
|
|
|
9ae3a8 |
Signed-off-by: Fam Zheng <famz@redhat.com>
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
block/iscsi.c | 12 +++++++-----
|
|
|
9ae3a8 |
1 file changed, 7 insertions(+), 5 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
block/iscsi.c | 12 +++++++-----
|
|
|
9ae3a8 |
1 files changed, 7 insertions(+), 5 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
diff --git a/block/iscsi.c b/block/iscsi.c
|
|
|
9ae3a8 |
index b80ebd3..78ab91e 100644
|
|
|
9ae3a8 |
--- a/block/iscsi.c
|
|
|
9ae3a8 |
+++ b/block/iscsi.c
|
|
|
9ae3a8 |
@@ -1510,18 +1510,20 @@ static int iscsi_refresh_limits(BlockDriverState *bs)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
/* We don't actually refresh here, but just return data queried in
|
|
|
9ae3a8 |
* iscsi_open(): iscsi targets don't change their limits. */
|
|
|
9ae3a8 |
- if (iscsilun->lbp.lbpu || iscsilun->lbp.lbpws) {
|
|
|
9ae3a8 |
+ if (iscsilun->lbp.lbpu) {
|
|
|
9ae3a8 |
if (iscsilun->bl.max_unmap < 0xffffffff) {
|
|
|
9ae3a8 |
bs->bl.max_discard = sector_lun2qemu(iscsilun->bl.max_unmap,
|
|
|
9ae3a8 |
iscsilun);
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
bs->bl.discard_alignment = sector_lun2qemu(iscsilun->bl.opt_unmap_gran,
|
|
|
9ae3a8 |
iscsilun);
|
|
|
9ae3a8 |
+ }
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
- if (iscsilun->bl.max_ws_len < 0xffffffff) {
|
|
|
9ae3a8 |
- bs->bl.max_write_zeroes = sector_lun2qemu(iscsilun->bl.max_ws_len,
|
|
|
9ae3a8 |
- iscsilun);
|
|
|
9ae3a8 |
- }
|
|
|
9ae3a8 |
+ if (iscsilun->bl.max_ws_len < 0xffffffff) {
|
|
|
9ae3a8 |
+ bs->bl.max_write_zeroes = sector_lun2qemu(iscsilun->bl.max_ws_len,
|
|
|
9ae3a8 |
+ iscsilun);
|
|
|
9ae3a8 |
+ }
|
|
|
9ae3a8 |
+ if (iscsilun->lbp.lbpws) {
|
|
|
9ae3a8 |
bs->bl.write_zeroes_alignment = sector_lun2qemu(iscsilun->bl.opt_unmap_gran,
|
|
|
9ae3a8 |
iscsilun);
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
--
|
|
|
9ae3a8 |
1.7.1
|
|
|
9ae3a8 |
|