From patchwork Fri Mar 14 06:00:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fam Zheng X-Patchwork-Id: 3830971 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0B221BF540 for ; Fri, 14 Mar 2014 06:01:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 20F9C202EC for ; Fri, 14 Mar 2014 06:01:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4467E202F0 for ; Fri, 14 Mar 2014 06:01:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752283AbaCNF76 (ORCPT ); Fri, 14 Mar 2014 01:59:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36029 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752170AbaCNF75 (ORCPT ); Fri, 14 Mar 2014 01:59:57 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s2E5xt0s026210 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 14 Mar 2014 01:59:55 -0400 Received: from T430.nay.redhat.com ([10.66.6.152]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s2E5xpY8008788; Fri, 14 Mar 2014 01:59:53 -0400 From: Fam Zheng To: linux-kernel@vger.kernel.org Cc: linux-scsi@vger.kernel.org, kvm@vger.kernel.org, pbonzini@redhat.com, hare@suse.de Subject: [PATCH v2] scsi: Change sense buffer size to 252 Date: Fri, 14 Mar 2014 14:00:05 +0800 Message-Id: <1394776805-6784-1-git-send-email-famz@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP According to SPC-4, section 4.5.2.1, 252 is the limit of sense data. So increase the values. Tested by hacking QEMU to fake virtio-scsi request sense len to 252. Without this patch the driver stops working immediately when it gets the request. Signed-off-by: Fam Zheng --- include/linux/virtio_scsi.h | 2 +- include/scsi/scsi_cmnd.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/virtio_scsi.h b/include/linux/virtio_scsi.h index 4195b97..a437f7f 100644 --- a/include/linux/virtio_scsi.h +++ b/include/linux/virtio_scsi.h @@ -28,7 +28,7 @@ #define _LINUX_VIRTIO_SCSI_H #define VIRTIO_SCSI_CDB_SIZE 32 -#define VIRTIO_SCSI_SENSE_SIZE 96 +#define VIRTIO_SCSI_SENSE_SIZE 252 /* SCSI command request, followed by data-out */ struct virtio_scsi_cmd_req { diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index 91558a1..a64dac03 100644 --- a/include/scsi/scsi_cmnd.h +++ b/include/scsi/scsi_cmnd.h @@ -104,7 +104,7 @@ struct scsi_cmnd { struct request *request; /* The command we are working on */ -#define SCSI_SENSE_BUFFERSIZE 96 +#define SCSI_SENSE_BUFFERSIZE 252 unsigned char *sense_buffer; /* obtained by REQUEST SENSE when * CHECK CONDITION is received on original