From patchwork Sat May 16 07:17:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akinobu Mita X-Patchwork-Id: 6419241 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 654899F374 for ; Sat, 16 May 2015 07:18:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 917FD204A7 for ; Sat, 16 May 2015 07:18:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B444D204B0 for ; Sat, 16 May 2015 07:18:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933047AbbEPHSw (ORCPT ); Sat, 16 May 2015 03:18:52 -0400 Received: from mail-pd0-f169.google.com ([209.85.192.169]:33714 "EHLO mail-pd0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753552AbbEPHSa (ORCPT ); Sat, 16 May 2015 03:18:30 -0400 Received: by pdbqa5 with SMTP id qa5so52169247pdb.0 for ; Sat, 16 May 2015 00:18:30 -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=s1mdIWnqBYBf+vNhuqgM0efMm4h5GuwHRJ6NtqxzqMc=; b=AbtlFtxTI6ZieeGiPOCQEejbIsJmKuSzMCGnD+HiW6mLibMst3ri8YJLkDNENF40er KtDXDzsnwY0oY2ycb5CxAJQvIP9+QWqxBHyIIFdd67YqVRL69A+EYVBGo6qdNvCco4oT e463Mm6xiVgNhYAC+CF8swx3tQfOL2nrp2LUY9ZHJ8nvgXA4eVWuhisJ9mZUK6rL4D5c va6dsWgfj1+nPq3z3BoKIFP3O5tuQqzrg0I1uwNBOt1WS+JbAP4x84XvzqzOQy5lYKQ5 hL4FAtu3HvDYL9fmVRIaebl1mcFSWEu4ZD80GlxKmJXoOCwsnXUqlvONY2eXETgzeiR3 w9Mw== X-Received: by 10.70.29.4 with SMTP id f4mr25755022pdh.23.1431760709993; Sat, 16 May 2015 00:18:29 -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.26 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 16 May 2015 00:18:28 -0700 (PDT) From: Akinobu Mita To: linux-scsi@vger.kernel.org, "James E.J. Bottomley" Cc: Akinobu Mita , Adam Radford Subject: [PATCH 2/7] 3w-xxxx: fix transfer length 0 for 6-byte r/w commands Date: Sat, 16 May 2015 16:17:48 +0900 Message-Id: <1431760673-7180-3-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: Adam Radford Cc: linux-scsi@vger.kernel.org --- drivers/scsi/3w-xxxx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/scsi/3w-xxxx.c b/drivers/scsi/3w-xxxx.c index 2940bd7..e836aee 100644 --- a/drivers/scsi/3w-xxxx.c +++ b/drivers/scsi/3w-xxxx.c @@ -1727,6 +1727,8 @@ static int tw_scsiop_read_write(TW_Device_Extension *tw_dev, int request_id) if (srb->cmnd[0] == READ_6 || srb->cmnd[0] == WRITE_6) { lba = ((u32)srb->cmnd[1] << 16) | ((u32)srb->cmnd[2] << 8) | (u32)srb->cmnd[3]; num_sectors = (u32)srb->cmnd[4]; + if (num_sectors == 0) + num_sectors = 256; } else { lba = ((u32)srb->cmnd[2] << 24) | ((u32)srb->cmnd[3] << 16) | ((u32)srb->cmnd[4] << 8) | (u32)srb->cmnd[5]; num_sectors = (u32)srb->cmnd[8] | ((u32)srb->cmnd[7] << 8);