From c12cdb2e6d4c10564266623416f041853ba8fd00 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Tue, 8 Oct 2013 15:15:26 +0200 Subject: [PATCH 2/2] scsi: Fix data length == SCSI_SENSE_BUF_SIZE RH-Author: Paolo Bonzini Message-id: <1381245326-404-1-git-send-email-pbonzini@redhat.com> Patchwork-id: 54780 O-Subject: [RHEL 6.5 qemu-kvm PATCH] scsi: Fix data length == SCSI_SENSE_BUF_SIZE Bugzilla: 956929 RH-Acked-by: Kevin Wolf RH-Acked-by: Amit Shah RH-Acked-by: Markus Armbruster From: Christian Hoff Bugzilla: 956929 Brew build: http://brewweb.devel.redhat.com/brew/taskinfo?taskID=6385062 Fix the edge case where the sense data length is exactly the same as SCSI_SENSE_BUF_SIZE. This makes SCSI requests work that use all of the available 95 byte sense data. [Really should be "all of the available 96 byte sense data". - Paolo] Signed-off-by: Christian Hoff Signed-off-by: Christian Borntraeger Signed-off-by: Paolo Bonzini (cherry picked from commit 335f560f9c7b63ede973d7b9712438f39ee2df61) --- hw/scsi-bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Signed-off-by: Miroslav Rezanina --- hw/scsi-bus.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c index d6ffc05..6a93d11 100644 --- a/hw/scsi-bus.c +++ b/hw/scsi-bus.c @@ -1408,7 +1408,7 @@ void scsi_req_complete(SCSIRequest *req, int status) assert(req->status == -1); req->status = status; - assert(req->sense_len < sizeof(req->sense)); + assert(req->sense_len <= sizeof(req->sense)); if (status == GOOD) { req->sense_len = 0; } -- 1.7.1