From patchwork Thu Mar 30 17:12:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 9654859 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 A79C960113 for ; Thu, 30 Mar 2017 17:13:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 92268285BD for ; Thu, 30 Mar 2017 17:13:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 86A0E285C1; Thu, 30 Mar 2017 17:13:02 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 A639A285C0 for ; Thu, 30 Mar 2017 17:13:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933375AbdC3RNB (ORCPT ); Thu, 30 Mar 2017 13:13:01 -0400 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:43016 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933024AbdC3RM4 (ORCPT ); Thu, 30 Mar 2017 13:12:56 -0400 X-IronPort-AV: E=Sophos;i="5.36,247,1486396800"; d="scan'208";a="7316750" Received: from mail-sn1nam01lp0113.outbound.protection.outlook.com (HELO NAM01-SN1-obe.outbound.protection.outlook.com) ([207.46.163.113]) by ob1.hgst.iphmx.com with ESMTP; 31 Mar 2017 01:12:55 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-sharedspace-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=jSklau19djV1cAv3YGHa8wYf3DC8iwxqMQwHGarJH/U=; b=sGi3Sx7km4vSZc3lkIVejcr7jcv4/jJcLWc8GsP3CdTtK3Ta8WeNIQMEdStInBlh992Zlpw59SJEesAsX/zDwDDFPR+gtIBrJqtjQOZZv1A4R9BIDEXNR4oV/Of8KC+2kxSYr5sb7d/goCT7mlj5ODqOqpVcYJdT7rTcjW5cDOQ= Received: from BN3PR0401CA0024.namprd04.prod.outlook.com (10.162.159.162) by BN1PR04MB108.namprd04.prod.outlook.com (10.255.199.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.991.14; Thu, 30 Mar 2017 17:12:51 +0000 Received: from CO1NAM04FT012.eop-NAM04.prod.protection.outlook.com (2a01:111:f400:7e4d::200) by BN3PR0401CA0024.outlook.office365.com (2a01:111:e400:51d1::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1005.10 via Frontend Transport; Thu, 30 Mar 2017 17:12:51 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.21) smtp.mailfrom=sandisk.com; linux-iscsi.org; dkim=none (message not signed) header.d=none;linux-iscsi.org; dmarc=bestguesspass action=none header.from=sandisk.com; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 63.163.107.21 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.21; helo=milsmgep15.sandisk.com; Received: from milsmgep15.sandisk.com (63.163.107.21) by CO1NAM04FT012.mail.protection.outlook.com (10.152.90.115) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1005.5 via Frontend Transport; Thu, 30 Mar 2017 17:12:50 +0000 Received: from MILHUBIP03.sdcorp.global.sandisk.com (Unknown_Domain [10.201.67.162]) (using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by (Symantec Messaging Gateway) with SMTP id F2.BD.29323.19C3DD85; Thu, 30 Mar 2017 10:12:50 -0700 (PDT) Received: from milsmgip12.sandisk.com (10.177.9.6) by MILHUBIP03.sdcorp.global.sandisk.com (10.177.9.96) with Microsoft SMTP Server id 14.3.319.2; Thu, 30 Mar 2017 10:12:48 -0700 X-AuditID: 0ac94369-548749800000728b-49-58dd3c9152a3 Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id AB.29.18148.09C3DD85; Thu, 30 Mar 2017 10:12:48 -0700 (PDT) From: Bart Van Assche To: Nicholas Bellinger CC: , Bart Van Assche , Max Lohrmann , Subject: [PATCH 1/6] target: Fix VERIFY and WRITE VERIFY command parsing Date: Thu, 30 Mar 2017 10:12:39 -0700 Message-ID: <20170330171244.8346-2-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170330171244.8346-1-bart.vanassche@sandisk.com> References: <20170330171244.8346-1-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrILMWRmVeSWpSXmKPExsXCddJ5ke4km7sRBpcbmS3aVp9htHj6ONxi wcZHjBatS98yObB43N9+hMnj8yY5j+srupgCmKO4bFJSczLLUov07RK4Mha+eMlScF+mYu+C u0wNjJPFuxg5OSQETCS+nfjE1sXIxSEksJRJYv7/F0wQzjZGiZcNb1lgqi5dPQBVtZlR4vrU RcwgCTYBI4lv72eCFYkI6EjMuvuCHaSIWWASo8Sf0y9ZQRLCAh4SD2Z8AGtgEVCV2P3zDtAK Dg5eATuJrQudIRbISyzaNANsDqeAvcSFa4vYQWwhoJJ37X1gMyUEmlglnhxrApvJKyAocXLm E7AGZgEJiYMvXjBDNKhLnFwyn2kCo9AsJGWzkJQtYGRaxSiWm5lTnJueWmBoqlecmJeSWZyt l5yfu4kREtCZOxjvPvE+xCjAwajEw7tD8G6EEGtiWXFl7iFGCQ5mJRHeDmugEG9KYmVValF+ fFFpTmrxIUZpDhYlcd5zMlMjhATSE0tSs1NTC1KLYLJMHJxSDYz54puFr667nWJpd+pTL8cT Ez070wzbxGWTExQe+Tw8EGR4jWVntkYJT7XXkyntbi//nD3vfmyC6EVjwzWKHV6L2RySWYyS 5v7T3dlzw5Tv1rk12owmB9fPFVq/x8kiJFviac8Ep/h1y6IKNrrvn/DI7I9qW8376j83+d7v 8WRlqTn4+dxSTTslluKMREMt5qLiRAB9tT8IZAIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrIJMWRmVeSWpSXmKPExsXCtZEjRXeCzd0Ig1PXhCwO/mxjtGhbfYbR 4unjcIsFGx8xWrQufcvkwOpxf/sRJo9pa84zeXzeJOdxfUUXUwBLFJdNSmpOZllqkb5dAlfG whcvWQruy1TsXXCXqYFxsngXIyeHhICJxKWrB9i6GLk4hAQ2Mkp8PL2WBSTBJmAk8e39TDBb REBHYtbdF+wgRcwCExglDkw5ywiSEBbwkHgw4wMziM0ioCqx++cdJhCbV8BOYtfnyewQG+Ql Fm2aATaIU8Be4sK1RWBxIaCad+197BMYuRcwMqxiFMvNzCnOTc8sMDTSK07MS8ksztZLzs/d xAgOBM6oHYzXJ5ofYmTi4JRqYFx6OtqSbd/JHW+6Fxsz5zuemevz8fomFhfVTWs2iuy9xer7 8GfYUQ1vUc6eM6kfZ62JndoewsgVv/3R/upW+x/ZCXWrXF/9cnORnfNlw/XpF3cHsc0xiNw/ Qfu4cN+hxoB/jr+i764SZlo70+jQ8m0WivfNdmbnvFe60zNhp53yy93Bt69FB19SYinOSDTU Yi4qTgQAhOm/ZbQBAAA= MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:63.163.107.21; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(39410400002)(39850400002)(39400400002)(39860400002)(39450400003)(39840400002)(2980300002)(438002)(199003)(189002)(9170700003)(2950100002)(81166006)(6666003)(8936002)(50226002)(305945005)(8676002)(33646002)(6916009)(5003940100001)(38730400002)(356003)(77096006)(5660300001)(110136004)(54906002)(36756003)(4326008)(76176999)(50986999)(1076002)(106466001)(189998001)(15650500001)(53936002)(86362001)(47776003)(50466002)(2906002)(48376002)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:BN1PR04MB108; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM04FT012; 1:uc5ENQA1EA763D7cpkQfjBNXxg2Cpx/C46RIHhimXwJablPZKDqqaffNWtJl5FIUXp1kobDhX9bdkUJtaf8FiOGgJWR5mKVVtxJgivvBAvo4ypZHd0dvyCdMMbfBzDL1RMxZXKvmJnS5ZGLxDslQxSeaONJDRj5PSHWS2ZEsFeT3ZNa1nW6AQ/SLNoOfjb4OOCQtbvjF3fecTZLHdUMvqRJdKpnAcNzVJRC0Qd904hnQOIx+RLAKjdECiNbDUvOk29YJ/1ic0or4VQGFElh3inOGPXftSfZVMn5mF0XQOBRRGMcij4JS63+j2t4TTWiwzfRGP5N0gPF1PWvNAmbQTRqoElK7OPtBQSOZLwQksWOjTyiPUYYoFKvcRlDb2QG7YFumJE2YJY0aewKf3p2F9qgUWKCs9Qa3eatF940WlTRFpyJTita2ghoxLaCJZNb7FnO0NF3COegPDlW9W6xdUd6/9w3bmsRRSdat+Rwv/F7leB5bfjOYOstgvUP7XpMR X-MS-Office365-Filtering-Correlation-Id: 97302f6c-94c9-4804-5b1e-08d4778fff16 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(2017030254075)(201703131423075)(201703031133081); SRVR:BN1PR04MB108; X-Microsoft-Exchange-Diagnostics: 1; BN1PR04MB108; 3:KvQBXM5mSiFWxTzt4QPa+MLqlBiomqIkHvHq9nserDPwerEUJV2L2+S4JSE5oIUtazLXHLwJB0/STIYb7O12Yd251OzVTc8oUxJ+F0mgy0zL5ayIRvYFRLvF/EdqrtKoyeY2E4owJ+TGmpBmVeSZ8gImnk1I7GRTTpT86N99EngscQCL4h0L8AH5IYdW1uDjtDhvlgwZvP8vwNk1rKktbiKrKyq0xhzewZckyWu5qfsE/KtYhiuf/R2UkaL9ARLCZSsQdyeYA7j8RsVg8fwEWy5cwl+fk0LoWfxcxVu5prsT8vQKVwx0xom0KsZrDUtTP0HuvggE7ayo1+fimyNWQg5ZNF2+rldxh/lwCMuBQjY44iI3r5p/5DTPYnegC1RtjiV0fW+2opk9NPZGPgtmcb5ovhoIwfEOE7wHK6P6TQPRHmh/p+77UsziW1LyLy8/wNu59wQ+fKIQqNXkXAS2KAmyLyFuqHP8SgIEWZ5RFoUXDtIz6LhjaG8KcubSe2wz X-Microsoft-Exchange-Diagnostics: 1; BN1PR04MB108; 25:RP1shF2LVQtl45/OGbnZQdtFlmqx1m9F+2F2E7WKxBZj9XLEqsz9MqyCErnKc0cV17G0qE5OUIPqdHBiZ5Im6XruDkrbnCL8We1CH0h3ha75k5irmXyTxpvcjrD120fN4U4Q3j6vIk6ecKr0Lp/HQYe8Cu8CU4/M5LFuOVYzeYU3Oap1joCbyVOFdDgWDCAjdBpR7rEuTuI0fxouNjg4qc5E0u7VVX31eCQdvGg3sB6srx4J54yAAiuNx1a1ig6zlY8/Dc5XeiQNpplUV6qNUnltQfaQwTPQPYUND77go8le2Oy50PTGwM2cGFJg0fW8ci5SwUWIIWqMO2OJx52n3dJDEaaUR+avXwzaM3Ot6rCBLe8voRXp5FitE+CD1REGki+Lbf1d/4myiE/tJtVVLspj4ccGZ9XoSbv5zmxyMqjMQhMS9Js82jeyDqE392xazu7r6kH80FtrXCz9HfiFkA==; 31:VL3twtazvih4YnpzhxpkN6zicetgLPE234u3a5PuOvQ+WcigJdb0yzZqln92YcX7Dpp6zfeJ/pFdGi/0T4QMEGuhrP0NHEkDEx0I2MSejVnZP0JPCWgbqvrkAo0axeUXYvGxaajomiF///ypzL37cmCtx6bDxzab1bOHCKwYoq199LftGvxHF3rdsIwH0yYlT1aUnWnp/RwjabF82Hgpx4J/p371bTwBTRjC+tvx2L4wjrGiq5nOfSyYyJ3OOIkDFHriNIQz7Vuxpr0b9FbfIzgFTpNOrLxyM51smlDjx1Q= WDCIPOUTBOUND: EOP-TRUE X-Microsoft-Exchange-Diagnostics: 1; BN1PR04MB108; 20:HB51fxb/l4OjjOYqC1CxzmqPSq4OLjZhbMl+zZzSfnjBm+XHKcfQkPf4mAMnPWPMJm37c4q6LxsWh7KeI2QgaJ8QEQVzYKW/LZCU4dwH4CdMD8mfI0Ud8h5nxy1QAh3nRJ/uyHOMxhgt5LN9IyjJIs+qbQNP0pcWYvDzBc+IG6Tvj4Hr3dJIb6JZeujvzZYk5b9Wwcss0NdrYs9gmlDZzvM7dbPcA4eTzUOkfrMPzB3//vSVD+KkXx7XSrBDb4EMvbY+Kp+HHMx+pTQ+dqRJGrS5Smgfrm5WIwQU03Poqzy+lL4jiv4oHpHXhBAlShR6nTeknxehIN6Du+sFzY1FfXLWjvPZSCD1CFcalP7vmU2ZpAfCtObB4dyGsZRKEzQZNrNWvj20QgPZFiDBM944weCZgcrmZc+yf3sA2hRb5AbAlOkXXGK4fVJJc8WULqULLcbA2TrPgn87dCj1wVwlO9yX/MjOu4LbCpmElbX5QmgXNVFVzXAuVMG7hEh/h3ST X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(9452136761055)(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(13016025)(5005006)(13018025)(10201501046)(3002001)(93006067)(93004067)(6055026)(6041248)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(20161123555025)(20161123562025)(20161123560025)(6072148); SRVR:BN1PR04MB108; BCL:0; PCL:0; RULEID:; SRVR:BN1PR04MB108; X-Microsoft-Exchange-Diagnostics: 1; BN1PR04MB108; 4:y1BnTaTT3yrs5FWHI0VRaY0bs/Fh1dnlWpnmKV7Jda+AcadHDTrurrzHDBibxKxNRvM7QhsBt2e9mZex4ooFgfK5VPK+8vun8GFEOpM6+JWinGWEo5ToAo9HD14+lKvNuoQTC2qBYWJbPQfcq957wNYGvb8cGKFKSLREmsxLYYMYPSQXcvWy/o1JIAmSUUm0+ZgUpj7T6afJndSjhNBpTOmnAU05p94MuERstWig0iELGev4JXgzi8VGMAJTpRFosAtpAQzZHdofVxkQ3nO8zIqLLimiI2E6P1QtLXnokYuBKF79nnGO4tOPnn3NMOQTmh+uSxW0LCn2f+8ulUsUsbHlre26MJnwv2TEhkLazXruPW6Yj2dEqW/Jnx/ZRI0GJUHdZ9O/duNBpySJJlwKZujx2Rm0u8ss0hwVUqOu2A1clmEOkntIJW/3f+nqkYb5L8DNaXPpEY0B/6/UNzbR0oSXw4fE4NpasoLSR9qjVCv8t0eI5AdGdadxXtycXTo75rbUss8cOP82PjGv4fwqsabm2aCeFrnc+VudubliBOFr0iOPVqLUv4ib7hAmHynU8Zx84TRGRIHS59mmqLrAoLm2CvprMEFjnPjgp3Tk2dOwDU60ehB8MlAn66RuUHwtRHdnFR/Sjl4Ff7/ZGpODLhDj8G2kh6hPQUOylke+Co6mAtDjSf69KyG5mTN0upzHPFgFIQ1Jb8CCwem3IhMPjn0SVB4rSxi1MMgVGY+qjHAgq0sEj9thA8ilRF3+nAR9gaQsW5oSsYldmXr5d6pS2hdmAN8B2YINdj0KRTiOPOmyP3KIsP76emAwAW1PeeZHKyOl6BriXHE73KUMFGEHUVtnZk6WbwCi+inE4l3BeYc= X-Forefront-PRVS: 02622CEF0A X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN1PR04MB108; 23:0Vuuba0lySF7jlZVe60z98jiWaD25BPD3zMlhRW1pq?= =?us-ascii?Q?Oi7qHZC2y+LmfH/CH8dUOJZGRHQEs0YOJhk/WLaKgI6zl7/dSeNG7JKSKkfC?= =?us-ascii?Q?4+a0+SzF6MVk6bwYEZ2UROQDpUi6GPnopUIYkISoHfF4PdQGg2qOvWuXD+iW?= =?us-ascii?Q?l8tBfS/WuRtty1T1LH7VLXX1oLePw6BpHOHvsFcsmP4YafTf9uJEScqkyuNG?= =?us-ascii?Q?F+xJ2AdG2fQHD1D6D5BbbZ8F739BoaEtT4uxXn4menukuL1x3qxop7LW24ck?= =?us-ascii?Q?YqX0QM8bzlayELxZjfF20VpWSrdyYlhGgjg13BgoZ2u+hdqD6OrQlWBRMaDG?= =?us-ascii?Q?gprWbwjSN4V8w67ocY9bSvz1A+6jbumMbGNPIfHr4dyq1ZN1btnFBvedaABu?= =?us-ascii?Q?pri0MGnscjZN2oW3z8rgGro2HwNQnaUzAc3AIoT2cswT2BUsAZBjL/XuPifz?= =?us-ascii?Q?JER39NQ+5hX5LOosEbvU8vxtOJG2JDQ9eh7+0jT+gMRAhhJsl0+hif2dh9N/?= =?us-ascii?Q?eVtwf4VXIJwP43U7IoCeOTbgIG9R7JvaLKi3tPogY6Uya2RpksMr294HNw6q?= =?us-ascii?Q?qzG+VkynwENxadz0T7SwfIcxXH8+TiWiVp0PnaGpdFoWDBtc42bGgGEtN5v1?= =?us-ascii?Q?2JDkp/hlZEyE48SlYj1uodgJYc+SeSLgWDsxUOA4KpvUuvr1A7WloBjjEyJr?= =?us-ascii?Q?kvZnTlJKo7iu25v09lJWc048nJ3xTK1PdwsIDiSpwRby123DV/xGPgOMzFql?= =?us-ascii?Q?+CpyxZDkXIAh6Xg8wFVBGz/bIZ/tuzHjz2pxJfGf5nX6WdKStepm18jPebOF?= =?us-ascii?Q?hJuAzDLbzo0pD3IQLFaMJrvBBaOMV59kZWDmP25hw662WTqFbXHR4EgsJx4X?= =?us-ascii?Q?5aPG+IVIRMKRtli+IO348LRVgSvW+MUzSADpve+CtE01m6i1euzRMSSZa+IR?= =?us-ascii?Q?L8zAG3D6gG+qjO8tL6bMWfj3UPh04BZyR2ir+NU/6tX8Cyv4G7hXeETL3uHi?= =?us-ascii?Q?O04tHTWb9e5Lf0rXTsxe/8IGEcME6EvhrefGtLIms9GaLQGbZ5PHy4MiqAMQ?= =?us-ascii?Q?JueROTouD8Yy3Kb4C18CUIqPYzM/fA9fJJ92Ba0lfF6Z4JhA=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; BN1PR04MB108; 6:g+4SYk7+LdFvBRrttpdPLnxBe+9XmpayZ5ndQFo5YKR+WgcJaud8sE2u4l4qP20AXP4eQtzCIWfs1z1vNbOUWhQSFoGMR2tW4EAOCv9vFJCBVtZL3IWpbVhyB4iS4fu07v4ImK2k44pa7KjA71DFosdk6EuTdERiYYwTpkd1qYkpXK16QWDvtnDc4JGChWtdQpUyPeo1h7nvpb0rJDpi3cXpFpcZcvZFrkLnNUUFlUjHV85TJ28t46U/aKoai36My0GTQMRWiv5sGRbu120Ug1wUQDU5hWqcq//EI600ptyw5aZdKv64Nv7C9Mv13icnSeN023TMOTHGh+EnNeLneC4YnztooTd0p6CtL7P9pIcBxHjXnn+f3EboanDguUZu2wX55YEQ8F2oAXJoasqhlwdVLLaBOeBpi0XVDePphc4=; 5:V3/7v69akdcGr1Dd81SF+rH0vzLIW72Rj+qyo0ydwktOZVtKSHF6EYc7r/fxNtVrlqcvWh2vze8VjepJo+KXRWeyTiwQ6FpB6wnUpjOedgWof4Z5cGKqhPC6hTjr7n2cnfkW5MAmn93u/mnv86xT7Q==; 24:9d5inSVI6iLUvq0zV7AR9aPlzPEw6kyNPZsC0IAO2RGFYdwEWSORSDuJ72UpWcmBUPjVhZThjaMuOZUOJ7nwYHiSuOM52CTLdoN1hoc+7kI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN1PR04MB108; 7:Uz8iy/Mh9emtTvQmYCNvBM27H2XzHUtK80y63O/DBv+tgS2z6lc5ahawWO7ZbXsGLTgOB2mRi537F4JFbT+40pf8cBjEOE9XvlsgyS0/tEodfmHecAf6HXmoe+R9iaF7wZI6yw0hLu3YlT8+6LmNnPuInIjMBEcDPdXsM9z7MvxEC/QaqvOHoKiVHV0XllFKVMV+4+di/tD3bRbmqMrqzpu5PCITUqgLICkh1ls3Aqk2E1uDg2QIVOUpUR1DYi7R7W/FjQ6MxS8YBepRnEWeUYrzNBlKJ+G3zqMWCcW/xgxA+ZqJO1yPMzRXZOkFN6meO2hB2t0JAXEBEWF2pDgH4w==; 20:CLAclrkOLOaMZjNV0AfhqPheUXOzpUxBU3b4RdocFO6l0DYRBZG6Yt99zNtVdKcx/3jEt2yF9SJDne879lFMsftRrI7lGfF7HeezaVQ38m7NEq8Nyq5bektUWm1G/G6d76RclSxi3rf8e5DNqC6c7px2un/wxm+zGohuyJrmRXg= X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Mar 2017 17:12:50.7110 (UTC) X-MS-Exchange-CrossTenant-Id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=b61c8803-16f3-4c35-9b17-6f65f441df86; Ip=[63.163.107.21]; Helo=[milsmgep15.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN1PR04MB108 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 Use the value of the BYTCHK field to determine the size of the Data-Out buffer. For VERIFY, honor the VRPROTECT, DPO and FUA fields. This patch avoids that LIO complains about a mismatch between the expected transfer length and the SCSI CDB length if the value of the BYTCHK field is 0. Signed-off-by: Bart Van Assche Cc: Max Lohrmann Cc: --- drivers/target/target_core_sbc.c | 71 +++++++++++++++++++++++++++++++++++----- 1 file changed, 62 insertions(+), 9 deletions(-) diff --git a/drivers/target/target_core_sbc.c b/drivers/target/target_core_sbc.c index c194063f169b..ee35c90e3b8d 100644 --- a/drivers/target/target_core_sbc.c +++ b/drivers/target/target_core_sbc.c @@ -828,6 +828,59 @@ sbc_check_dpofua(struct se_device *dev, struct se_cmd *cmd, unsigned char *cdb) return 0; } +/** + * sbc_parse_verify - parse VERIFY, VERIFY_16 and WRITE VERIFY commands + * @cmd: (in) structure that describes the SCSI command to be parsed. + * @sectors: (out) Number of logical blocks on the storage medium that will be + * affected by the SCSI command. + * @bufflen: (out) Expected length of the SCSI Data-Out buffer. + */ +static sense_reason_t sbc_parse_verify(struct se_cmd *cmd, int *sectors, + u32 *bufflen) +{ + struct se_device *dev = cmd->se_dev; + u8 *cdb = cmd->t_task_cdb; + u8 bytchk = (cdb[1] >> 1) & 3; + sense_reason_t ret; + + switch (cdb[0]) { + case VERIFY: + case WRITE_VERIFY: + *sectors = transport_get_sectors_10(cdb); + cmd->t_task_lba = transport_lba_32(cdb); + break; + case VERIFY_16: + *sectors = transport_get_sectors_16(cdb); + cmd->t_task_lba = transport_lba_64(cdb); + break; + default: + WARN_ON_ONCE(true); + return TCM_UNSUPPORTED_SCSI_OPCODE; + } + + if (sbc_check_dpofua(dev, cmd, cdb)) + return TCM_INVALID_CDB_FIELD; + + ret = sbc_check_prot(dev, cmd, cdb, *sectors, true); + if (ret) + return ret; + + switch (bytchk) { + case 0: + *bufflen = 0; + break; + case 1: + *bufflen = sbc_get_size(cmd, *sectors); + cmd->se_cmd_flags |= SCF_SCSI_DATA_CDB; + break; + default: + pr_err("Unsupported BYTCHK value %d for SCSI opcode %#x\n", + bytchk, cdb[0]); + return TCM_INVALID_CDB_FIELD; + } + return TCM_NO_SENSE; +} + sense_reason_t sbc_parse_cdb(struct se_cmd *cmd, struct sbc_ops *ops) { @@ -895,7 +948,6 @@ sbc_parse_cdb(struct se_cmd *cmd, struct sbc_ops *ops) cmd->execute_cmd = sbc_execute_rw; break; case WRITE_10: - case WRITE_VERIFY: sectors = transport_get_sectors_10(cdb); cmd->t_task_lba = transport_lba_32(cdb); @@ -909,6 +961,12 @@ sbc_parse_cdb(struct se_cmd *cmd, struct sbc_ops *ops) cmd->se_cmd_flags |= SCF_SCSI_DATA_CDB; cmd->execute_cmd = sbc_execute_rw; break; + case WRITE_VERIFY: + ret = sbc_parse_verify(cmd, §ors, &size); + if (ret) + return ret; + cmd->execute_cmd = sbc_execute_rw; + goto check_lba; case WRITE_12: sectors = transport_get_sectors_12(cdb); cmd->t_task_lba = transport_lba_32(cdb); @@ -1106,14 +1164,9 @@ sbc_parse_cdb(struct se_cmd *cmd, struct sbc_ops *ops) break; case VERIFY: case VERIFY_16: - size = 0; - if (cdb[0] == VERIFY) { - sectors = transport_get_sectors_10(cdb); - cmd->t_task_lba = transport_lba_32(cdb); - } else { - sectors = transport_get_sectors_16(cdb); - cmd->t_task_lba = transport_lba_64(cdb); - } + ret = sbc_parse_verify(cmd, §ors, &size); + if (ret) + return ret; cmd->execute_cmd = sbc_emulate_noop; goto check_lba; case REZERO_UNIT: