From patchwork Thu Jun 14 13:55:25 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Borntraeger X-Patchwork-Id: 164936 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id DD388B703E for ; Thu, 14 Jun 2012 23:56:11 +1000 (EST) Received: from localhost ([::1]:47521 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SfAWv-0004FC-Kj for incoming@patchwork.ozlabs.org; Thu, 14 Jun 2012 09:56:09 -0400 Received: from eggs.gnu.org ([208.118.235.92]:57095) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SfAWb-0003z8-KF for qemu-devel@nongnu.org; Thu, 14 Jun 2012 09:55:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SfAWU-0002f7-AJ for qemu-devel@nongnu.org; Thu, 14 Jun 2012 09:55:49 -0400 Received: from e06smtp17.uk.ibm.com ([195.75.94.113]:58506) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SfAWU-0002eG-0p for qemu-devel@nongnu.org; Thu, 14 Jun 2012 09:55:42 -0400 Received: from /spool/local by e06smtp17.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 14 Jun 2012 14:55:38 +0100 Received: from d06nrmr1806.portsmouth.uk.ibm.com (9.149.39.193) by e06smtp17.uk.ibm.com (192.168.101.147) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 14 Jun 2012 14:55:33 +0100 Received: from d06av12.portsmouth.uk.ibm.com (d06av12.portsmouth.uk.ibm.com [9.149.37.247]) by d06nrmr1806.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q5EDtWDa2900168 for ; Thu, 14 Jun 2012 14:55:32 +0100 Received: from d06av12.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av12.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q5EDtVKV012858 for ; Thu, 14 Jun 2012 07:55:32 -0600 Received: from localhost.localdomain (dyn-9-152-224-198.boeblingen.de.ibm.com [9.152.224.198]) by d06av12.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q5EDtVZC012790; Thu, 14 Jun 2012 07:55:31 -0600 From: Christian Borntraeger To: pbonzini@redhat.com Date: Thu, 14 Jun 2012 15:55:25 +0200 Message-Id: <1339682129-1497-2-git-send-email-borntraeger@de.ibm.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1339682129-1497-1-git-send-email-borntraeger@de.ibm.com> References: <1339682129-1497-1-git-send-email-borntraeger@de.ibm.com> x-cbid: 12061413-0542-0000-0000-00000226EF56 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 195.75.94.113 Cc: stefanha@gmail.com, Christian Hoff , qemu-devel@nongnu.org, Christian Borntraeger Subject: [Qemu-devel] [PATCH 1/5] scsi: Fix data length == SCSI_SENSE_BUF_SIZE X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Christian Hoff 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. Signed-off-by: Christian Hoff Signed-off-by: Christian Borntraeger --- 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 64e709e..d1779a2 100644 --- a/hw/scsi-bus.c +++ b/hw/scsi-bus.c @@ -1295,7 +1295,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; }