From patchwork Sat May 16 07:17:47 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akinobu Mita X-Patchwork-Id: 6419181 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A2C619F318 for ; Sat, 16 May 2015 07:18:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C1B0B204B0 for ; Sat, 16 May 2015 07:18:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EA43C204A7 for ; Sat, 16 May 2015 07:18:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753532AbbEPHS1 (ORCPT ); Sat, 16 May 2015 03:18:27 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:33361 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752981AbbEPHS0 (ORCPT ); Sat, 16 May 2015 03:18:26 -0400 Received: by padbw4 with SMTP id bw4so53488273pad.0 for ; Sat, 16 May 2015 00:18:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=8cxvZsDqEiG6a+lnzi5QxzF5pLSWyepPw9DhLEgOr+g=; b=wX4qo1Uy1LYYa6WW4B6zGzvIC4l5oXSpWwWZ5YJYNDTSQkD9AKS2IIkloHRSgqGBpy P/caZ/EcamMzQPSsIYNmj1foHkknt4EnDRgjh0un9+gpUTbuTiu1Zw2WxKCFutTvTAaK h/UGGUvwNG5facqMh//d0/uoRc1Ech/i99iOGavCWirD1LwzWtKYFNHzOV+wDZjee9ve /vgmYPGbCANeKnf0HY1/NrzWDYE9pCZ2+3UBHFV2Vfgr/b/uPzn8GwsptIoE4sNuk4qD cMyG6uBz3k7tQensvxggrRDGVaRNSFPKUlE5gqiwdQFjtcrr+z9oRtvKXprdlmnRXbdb q7mQ== X-Received: by 10.66.231.42 with SMTP id td10mr24996558pac.98.1431760706566; Sat, 16 May 2015 00:18:26 -0700 (PDT) Received: from localhost.localdomain (KD106168100169.ppp-bb.dion.ne.jp. [106.168.100.169]) by mx.google.com with ESMTPSA id j14sm3804949pbq.29.2015.05.16.00.18.23 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 16 May 2015 00:18:25 -0700 (PDT) From: Akinobu Mita To: linux-scsi@vger.kernel.org, "James E.J. Bottomley" Cc: Akinobu Mita , Don Brace , iss_storagedev@hp.com, storagedev@pmcs.com Subject: [PATCH 1/7] hpsa: fix transfer length 0 for 6-byte r/w commands Date: Sat, 16 May 2015 16:17:47 +0900 Message-Id: <1431760673-7180-2-git-send-email-akinobu.mita@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1431760673-7180-1-git-send-email-akinobu.mita@gmail.com> References: <1431760673-7180-1-git-send-email-akinobu.mita@gmail.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 For 6-byte r/w commands, transfer length 0 means 256 blocks of data, not 0 block. Signed-off-by: Akinobu Mita Cc: Don Brace Cc: iss_storagedev@hp.com Cc: storagedev@pmcs.com Cc: linux-scsi@vger.kernel.org --- drivers/scsi/hpsa.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index 8895bc9..f1d667c 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c @@ -3326,6 +3326,8 @@ static int fixup_ioaccel_cdb(u8 *cdb, int *cdb_len) if (*cdb_len == 6) { block = (((u32) cdb[2]) << 8) | cdb[3]; block_cnt = cdb[4]; + if (block_cnt == 0) + block_cnt = 256; } else { BUG_ON(*cdb_len != 12); block = (((u32) cdb[2]) << 24) |