From patchwork Sat Jul 8 03:15:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tang.wenji@zte.com.cn X-Patchwork-Id: 9831325 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6EA25604D9 for ; Sat, 8 Jul 2017 03:17:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5035328504 for ; Sat, 8 Jul 2017 03:17:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 42BE828528; Sat, 8 Jul 2017 03:17:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1ABB328504 for ; Sat, 8 Jul 2017 03:17:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751916AbdGHDRB (ORCPT ); Fri, 7 Jul 2017 23:17:01 -0400 Received: from out1.zte.com.cn ([202.103.147.172]:40871 "EHLO out1.zte.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751812AbdGHDRB (ORCPT ); Fri, 7 Jul 2017 23:17:01 -0400 X-scanvirus: By SEG_CYREN AntiVirus Engine X-scanresult: CLEAN X-MAILFROM: X-RCPTTO: X-FROMIP: 10.30.3.20 X-SEG-Scaned: 1 X-Received: unknown,10.30.3.20,20170708105918 Received: from unknown (HELO mse01.zte.com.cn) (10.30.3.20) by localhost with (AES256-SHA encrypted) SMTP; 8 Jul 2017 02:59:18 -0000 Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id v683GsGl051229; Sat, 8 Jul 2017 11:16:54 +0800 (GMT-8) (envelope-from tang.wenji@zte.com.cn) Received: from localhost.localdomain ([10.118.202.203]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2017070811170123-3427547 ; Sat, 8 Jul 2017 11:17:01 +0800 From: tang.wenji@zte.com.cn To: Nicholas Bellinger Cc: tang.wenji@zte.com.cn, target-devel@vger.kernel.org Subject: [PATCH] target:fix the cmd size in passthrough_parse_cdb Date: Sat, 8 Jul 2017 11:15:44 +0800 Message-Id: <1499483744-10084-1-git-send-email-tang.wenji@zte.com.cn> X-Mailer: git-send-email 2.8.1.windows.1 X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2017-07-08 11:17:01, Serialize by Router on notes_smtp/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2017-07-08 11:16:35, Serialize complete at 2017-07-08 11:16:35 X-MAIL: mse01.zte.com.cn v683GsGl051229 X-HQIP: 127.0.0.1 Sender: target-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Tang Wenji The cmd size should be 4bytes form byte5 to byte8 when CDB opcode is PERSISTENT_RESERVE_OUT in SPC3 and SPC4 Signed-off-by: Tang Wenji --- drivers/target/target_core_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c index 1c7c57a..e8dd6da 100644 --- a/drivers/target/target_core_device.c +++ b/drivers/target/target_core_device.c @@ -1183,7 +1183,7 @@ passthrough_parse_cdb(struct se_cmd *cmd, } if (cdb[0] == PERSISTENT_RESERVE_OUT) { cmd->execute_cmd = target_scsi3_emulate_pr_out; - size = get_unaligned_be16(&cdb[7]); + size = get_unaligned_be32(&cdb[5]); return target_cmd_size_check(cmd, size); }