From patchwork Mon Jul 2 09:41:23 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 168545 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 6E65C2C009D for ; Mon, 2 Jul 2012 20:55:04 +1000 (EST) Received: from localhost ([::1]:44470 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sld9h-0005E0-1f for incoming@patchwork.ozlabs.org; Mon, 02 Jul 2012 05:42:53 -0400 Received: from eggs.gnu.org ([208.118.235.92]:46577) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sld8l-00049j-FZ for qemu-devel@nongnu.org; Mon, 02 Jul 2012 05:42:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sld8f-0006bX-3N for qemu-devel@nongnu.org; Mon, 02 Jul 2012 05:41:54 -0400 Received: from mail-wg0-f41.google.com ([74.125.82.41]:53147) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sld8e-0006YD-RS for qemu-devel@nongnu.org; Mon, 02 Jul 2012 05:41:49 -0400 Received: by mail-wg0-f41.google.com with SMTP id ds1so2606509wgb.4 for ; Mon, 02 Jul 2012 02:41:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=NT4lcBi0O6yojRuQ9MevNwMIvjVvdsxwYXQpexKwHjk=; b=Bb2zz29LK533XbGHiZ2i7h8gTJXqN67f0WY4VUk6/1pucptONpo1ItimPjARCkn/5b 9PjKgdNpBjrrE7JDEq3/CDDdoURKVLj5EkpALYRaseXn+ysY5kFSXQCAaB/fHQm7TbTV CiVaGoAmLkqJOuGq868PTqjXreOrPz3jblblyhrEigL54f45d2I4CDFcSGK4bgYpZEgr K4R5y69eq4EHOBHU/v19KpXZkWWxas66JcdJapX/n1R4sroxKOqLMvckwzIwzW/185tB ZW3gpuqNY+tGz6215VXxadfqIrmdzYpL2gXCuL2e6CVP9ddVwVf5kwNyi7dH2asIbnSD mkNA== Received: by 10.181.13.142 with SMTP id ey14mr15367004wid.19.1341222107851; Mon, 02 Jul 2012 02:41:47 -0700 (PDT) Received: from yakj.usersys.redhat.com (nat-pool-mxp-t.redhat.com. [209.132.186.18]) by mx.google.com with ESMTPS id bg10sm43224317wib.9.2012.07.02.02.41.45 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 02 Jul 2012 02:41:46 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 2 Jul 2012 11:41:23 +0200 Message-Id: <1341222087-24920-11-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.7.10.2 In-Reply-To: <1341222087-24920-1-git-send-email-pbonzini@redhat.com> References: <1341222087-24920-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 74.125.82.41 Cc: Christian Borntraeger , Christian Hoff Subject: [Qemu-devel] [PATCH 10/14] 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 Signed-off-by: Paolo Bonzini --- hw/scsi-bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c index 14e2f73..4e95eee 100644 --- a/hw/scsi-bus.c +++ b/hw/scsi-bus.c @@ -1389,7 +1389,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; }