From patchwork Mon Jan 23 19:14:53 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: 9533381 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 6B4D36020B for ; Mon, 23 Jan 2017 19:16:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5AB062838D for ; Mon, 23 Jan 2017 19:16:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4D75F28355; Mon, 23 Jan 2017 19:16: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 8344228355 for ; Mon, 23 Jan 2017 19:16:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750950AbdAWTQA (ORCPT ); Mon, 23 Jan 2017 14:16:00 -0500 Received: from mail-bn3nam01on0068.outbound.protection.outlook.com ([104.47.33.68]:32312 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750705AbdAWTP5 (ORCPT ); Mon, 23 Jan 2017 14:15:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sandiskcorp.onmicrosoft.com; s=selector1-sandisk-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=1t925FQtuBNIwwSjJymuJNhKyq7B7mTOQ4GW/f5mk8o=; b=EU/bJV80S3F7ly9/69QvIOoevj+atYGeK8rYPCOD0nTpRiMT0htEQzzClqw03Lmdyydbdw8Z75b4BW0kmiJaa2rBdeSWThX3zixFR4CCKKbDXEiH+8nZ1daI9GDKXOy1GtUYJxLfeiMA5O1Q8pl/Zj2y1w0id/4acz6GPW1PYI8= Received: from BN6PR02CA0061.namprd02.prod.outlook.com (10.175.94.151) by BY2PR02MB044.namprd02.prod.outlook.com (10.242.44.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.860.13; Mon, 23 Jan 2017 19:15:00 +0000 Received: from BL2FFO11OLC001.protection.gbl (2a01:111:f400:7c09::176) by BN6PR02CA0061.outlook.office365.com (2603:10b6:404:f9::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.860.13 via Frontend Transport; Mon, 23 Jan 2017 19:14:59 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.21) smtp.mailfrom=sandisk.com; chelsio.com; dkim=none (message not signed) header.d=none;chelsio.com; 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 BL2FFO11OLC001.mail.protection.outlook.com (10.173.161.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.803.8 via Frontend Transport; Mon, 23 Jan 2017 19:14:58 +0000 Received: from MILHUBIP04.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 AD.71.65426.76356885; Mon, 23 Jan 2017 11:03:04 -0800 (PST) Received: from milsmgip11.sandisk.com (10.177.9.6) by MILHUBIP04.sdcorp.global.sandisk.com (10.177.9.97) with Microsoft SMTP Server id 14.3.319.2; Mon, 23 Jan 2017 11:14:56 -0800 X-AuditID: 0ac94369-7dfff7000001ff92-a7-58865367abec Received: from exp-402881.sandisk.com ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id 03.A4.16817.D2656885; Mon, 23 Jan 2017 11:14:56 -0800 (PST) Subject: Re: [PATCH] iscsi-target: fix seq_end_offset calculation To: Varun Prakash References: <1484910873-30255-1-git-send-email-varun@chelsio.com> <99daad4d-0ef2-4315-7ace-48b47b4d18fd@sandisk.com> <20170123112338.GA1812@chelsio.com> CC: "nab@linux-iscsi.org" , "target-devel@vger.kernel.org" , "Indranil Choudhury" From: Bart Van Assche Message-ID: <82f2f427-e53b-4f2b-1f2b-5e85f265f86d@sandisk.com> Date: Mon, 23 Jan 2017 11:14:53 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <20170123112338.GA1812@chelsio.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrNLMWRmVeSWpSXmKPExsXCddJ5kW5GcFuEwbEbihYL535hsmhbfYbR onXpWyaLWetfMTmweDzdMYfV4/72I0wenzfJBTBHcdmkpOZklqUW6dslcGVs3buCvWCtaMWs NS+YGhhfC3YxcnJICJhIvF/+n7GLkYtDSGApk8St90+ZIZxtjBK3ftxjh6m6838jK1QVo8SG GbPAEsICjhINWxrAbBEBVYmPt/5BjZrDKLHvxRowh1lgLqNE29+FLCBVbAJGEt/ezwSzeQXs JI7cP8AGYrMAdd9ongMU5+AQFYiQ+LTVCKJEUOLkzCdg5ZwCBhJ7ps5gArGZgewji+awQtjy EtvfzgE7W0JgEavE3p8rwRqEBNQlTi6ZzzSBUXgWklmzkPTPQtK/gJF5FaNYbmZOcW56aoGh qV5xYl5KZnG2XnJ+7iZGSBRk7mC8+8T7EKMAB6MSD6+ERFuEEGtiWXFl7iFGCQ5mJRFelUCg EG9KYmVValF+fFFpTmrxIUZpDhYlcV63e1/ChATSE0tSs1NTC1KLYLJMHJxSDYxn3k/aMVHG U/l9f+KkqjcTTqzUeqmTu9mh5BjzpoynLZpb1NlkAiI12nev50zb9faH/2HbFV2zvuuKGHRZ KX0SnuJ2vurht/hZU13YVHY0c24OYVwl7bzEKoPNea5wEwv7kze33zSKXo32k1opNGdGX0hP hnXB1+JCzs7oGUV6xSV9k20bDiixFGckGmoxFxUnAgCTb01sfgIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrAJMWRmVeSWpSXmKPExsXCtZEjRdcgrC3C4NoTRYuFc78wWbStPsNo 0br0LZPFrPWvmBxYPJ7umMPqcX/7ESaPz5vkApijuGxSUnMyy1KL9O0SuDK27l3BXrBWtGLW mhdMDYyvBbsYOTkkBEwk7vzfyNrFyMUhJLCYUeLWq63sIAlhAUeJhi0NYLaIgKrEx1v/GCGK 5jBK7HuxBsxhFpjLKPF6Vg8zSBWbgJHEt/czWUBsXgE7iSP3D7CB2CxA3Tea5wDFOThEBSIk Pm01gigRlDg58wlYOaeAgcSeqTOYQGxmAT2JHdd/sULY8hLb385hnsDINwtJyywkZbOQlC1g ZF7FKJabmVOcm55ZYGioV5yYl5JZnK2XnJ+7iREchpyROxifTjQ/xMjEwSnVwChSsSTxMK/d DTXOV1eMFnzc8z/jcDPT7aI0g/faVVv/V79Yssbz4yelINVj+0KL7mW0OB+Z9ON7aeWP+w5F ASJad0631l9iuSDF4sprmZ3ZXXE/5InM+cx7GxJ6DPeLBxm2CTGfe5JWwFbloPooxEegOufj zdCWtX3fi9Yv3BN7W8jAsdliqxJLcUaioRZzUXEiAPgFnJfzAQAA 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:(10009020)(6009001)(7916002)(39450400003)(39860400002)(39840400002)(39410400002)(39850400002)(2980300002)(438002)(199003)(24454002)(377454003)(501624003)(189002)(4326007)(2906002)(356003)(33646002)(65806001)(97736004)(65956001)(4001350100001)(47776003)(69596002)(86362001)(31686004)(92566002)(64126003)(50466002)(305945005)(83506001)(189998001)(31696002)(230700001)(106466001)(2270400002)(53416004)(6306002)(54906002)(229853002)(6916009)(6666003)(110136003)(2950100002)(626004)(23746002)(54356999)(8676002)(38730400001)(68736007)(65826007)(50986999)(5660300001)(8936002)(81156014)(81166006)(77096006)(76176999)(53936002)(36756003); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR02MB044; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11OLC001; 1:5A18/FrnyoWUW62tCo0BEVZh1aAQPjB8tMVNYU+PKprTNeEG8uZ4A7nyZ0Mi6GhhgjDyPF+0eH6ebcXyioUVTRvOoigAHOh2E5v8YO4ZLGv/vp4822VL8SY6DwXp57IxmCwtdiz1NrCwG/n/mNp7zRvznX9KxMqo4CUFpxrilTISNrtQmsilBO68yE6IAjEZH1BljZKk6ghs/B79ZvBm336E9XGQ0yFZF1hdQLImrmT2XzxeBWFWKznUw+1YPBEBxZrLxRqQDhpx/G3yh7rI6q+ZubkYkD2sdXw4Ro14sljyMA8QQBpMGukReeVvrDpVMbckVfA62HxeKBki8+VnVLZgGUd2+igHPLLZeRbxUdZ77PVUgDG6MjvbZO6pX2LR3CXAZNIooZwViHscMP09eTJri4gEzWroOmbkxCEYjzwfVS1TZ8bdFcTcxDUAnBpcfGmig9oMtG3RRmevenbedA== X-MS-Office365-Filtering-Correlation-Id: c4fcbc96-85fc-4ada-374a-08d443c41fb6 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002); SRVR:BY2PR02MB044; X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB044; 3:GsuY90og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UPcu6e94yUMTvz2MDl7hy78zkDMHh/rFW2ewVklfDN2fbCXorIRp6Hp4ffyOHgAJtGpuijiBnm8mp0l5 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(13016025)(13018025)(5005006)(8121501046)(3002001)(10201501046)(6055026)(6041248)(20161123560025)(20161123562025)(20161123555025)(20161123564025)(6072148); SRVR:BY2PR02MB044; BCL:0; PCL:0; RULEID:; SRVR:BY2PR02MB044; X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB044; 4:EjrZV6hP8coW9RDU79KSY9aURrvpCny89l1lHyF61q2WXTuI3VaT5h2b1yJ3zzP9Hxpy00yJDQnbolMKXl1LmMqFCOXp/cbElflFEPDVQfAud7RIx//GNxrZb/v+hIa6FVAms6xZKF41xrdu4lftnmymDVWs34oOoBwD7u0F2pMFvXPi4S2SgNa2ItBERye0aQsAeWsi6mSSwT2ScM6M/P0ZjLH4aZavuP9fj6bvk+J2UTtRWmDJu4PtI33UhAoM03qi9IaG/HBt6FLenTtcgH04YE6ZFLWiC4hAGY/qkxJ+imFf84/fTPw8AFL9Iu/fKSdA+MUkPKK6WA1crARnkLh5PuFWyB5K0sxm/LAkI4cXf6BlQFmuSBZJuWi73qtSm+FJHwYUTqGzSgeXi6A+NTeIe6N+vHaEdBIXuy8sdZMlrTSRQTglEa+JrLzgMZeedDmL8OIrFa3xPCq9VXG7PsyvPwrcRVjbdTZg8W2vuq6Ysj+zl67414BafGbTMrdQjqk9VVuY+jcvSRK7yiKf7iBnVbWlKBLXWnTRrvpbZO4Rb4cijF9GLIAWAc7PH89XGiGMvJITgFCzpUj47UUGPhEZwTx1ZjxMWw7/GC282r0qYKNVIzUt9YtaqXxOee4kojueXsbP6hWkWKgtOrbA5aePhwH7mTO8gIujmwcCrCU= X-Forefront-PRVS: 0196A226D1 X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; BY2PR02MB044; 23:U4CZz6EsR5WJvQUl8Cq0VqnbeUFtgcNKdR9Ofa?= =?Windows-1252?Q?A40Ha8piE+BdT5jyzsOapohNlabveSZP9TQ6QSPZHnCI9ml18c0e9ldB?= =?Windows-1252?Q?/YYqF2oQWy4jVnFNbx1sbCQAQqD9nl3X9Uwnc/YuXG0M/iyYdNDeIXgO?= =?Windows-1252?Q?m8+mbCOeyvd6/bXvYC3d+P3QV6pm1L7S3QFbbrEWZBoOaNHj7xCaakgo?= =?Windows-1252?Q?rJwhyADZl309C35Fz21M+kBdhIDif0eClURFKYF1MbvTGCds9BCzBqCY?= =?Windows-1252?Q?xEYoqUiaIYupbJcDqwn4YM6Oxvt66FRTMiAclvMm2u2bSM1qqXEAC/Mj?= =?Windows-1252?Q?n4QHu0E1FC7RVAVHKhU7lnbT0n4HJl8h1m0lHStKbNwD7f+o+pvdhBnD?= =?Windows-1252?Q?NPgpHrI2BjPLZjGS84Qzoe07w5gkMwcP/iFlGMItFb3in5ZV+FiZhUSl?= =?Windows-1252?Q?4WRd26ixvcp60Mf+XYX/tQP7puf0hJ1NbVeqpqq9PUzZGed6W7EpvpkN?= =?Windows-1252?Q?vbx2jG2bT4F4zkJexgOmq9Juxvjhu+EQDnLGE+xCI6nKv93QTtGNXEy+?= =?Windows-1252?Q?24TDWJuJZw8UNL+exZ9S0grlEkdd6pn9u1IUzL2vrY3ZILzFhgInbE8O?= =?Windows-1252?Q?Saor4ufP9CelUBg6xod7sJXMFVj9tcjnqPQvzii5ZKmD2Q0a1RtsU3Hh?= =?Windows-1252?Q?67SBzbVYz6GfElIL8K95vBQPVHVSgz5VOetVE79oyyt6ZdKrgiO+I43y?= =?Windows-1252?Q?r1AqYrcOxZAXIl7/b55HDkoxvP4uPuqsKIJZhna3KKyfCcoDkgKP5Eba?= =?Windows-1252?Q?eprI7G5H1zL+wUequazEPXvaWP78aUdin0iDRFLYCeRRG20xmSeAHus8?= =?Windows-1252?Q?pAYolHUNJK85uqJPoi4LY+PFE3xC3GWkyfMg9M3NfJCeCirNh5yMUtJ+?= =?Windows-1252?Q?gd8xfgZZjsenT4BcS0zqtynuoz1608f6NyIHbbm1+XaQybIzGF3nnTkT?= =?Windows-1252?Q?+altvIUmSpNa+6mqM5U2R/Wbef3ntMZI4d1/kolJ/mwRJYM8REWuf1vF?= =?Windows-1252?Q?vWhRSssuKaqtYmR6iwJ6UlLsPm77XG4P30on/dhW83rdu5EWP/ck1RxQ?= =?Windows-1252?Q?U8YpfWQnNAlKpvG/bAGZ/rJWbf2mmL5zLNqfVYG6iBsyC7E+M2DC5KGD?= =?Windows-1252?Q?d1bZ5fVaxvGBbX9bfPRfba2TvrPrJ5WgTGy/mXn1ag1mKVJBeydUsCEv?= =?Windows-1252?Q?kNokb5+I6GbQaeJQPH2u8bFHV+CdSRiUIcC9GqZcvmWIbI/XphtAN/sp?= =?Windows-1252?Q?PXpbb6FlQsw8wWjwvMwV/wqgnMYeCaBaxuUnqxRILEz4CGU1nirDGRVe?= =?Windows-1252?Q?Le4WzKquofB1VI0LG1ZNzwb0QYXQ0tSuGzi076o0bS7+igFRuYSYjO9X?= =?Windows-1252?Q?IvI6UzcfJN3V832NYXRo2vuJirlC6D/HXo//J063GyQ4UxBw0xoi55vu?= =?Windows-1252?Q?VnWrEcWte0+jsAnlJSZpvQRbVdKPML1/VHWnEAOcANl0eQcXZnJdj84l?= =?Windows-1252?Q?YnYKeUEOdzk4w=3D?= X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB044; 6:r9tP26pOSZWh8VcUo3ob/56gu9nFbsHdVVbxK6A2GlTrq3KfqKEFKMYYXabxobA8afbrTR9/i+orhST3KVwn9EoR/ibFLg5Ap2u8nsWtfhywmgKIQ8mvUCl50lF9xv+bC7ssxyQA9sy18CvA10RFgoQmmyUZcvBXuSoLzmf2vl9KyZQHl+QXzIBN8lXNlLG5cvJIhEJVGPVLsIODUNKd4E+uWflj9l8tKTCpHM8JhZeYDgv0Qk8RW5parJamBjR1NV9i8c2iMcQ27E3dFPmm28H7EeQbU1CpySFEbvD7/gsSm5SSWQLDytJOVMB6UL3RUHSukTanrYmvz8I/UWR+aLzu1Mno1ncbzA9bBNyOUQYdzyR1jsCL8VFQZnKnWVie559t9Am0S/REnm5OX6xgPGChLM+KIU6tOMslUEuJc690f2O/+utAS3eIPHcQHNtpNsmAKNG1ghBf/wEmybp0rw==; 5:0togR3pcpC/ZmNxXYzA6kRsSn3kG1V+AT8aygkj3DqS7vfbeHMmFEuWQ9uGPj8Qwxsspa9XV1+AOQ88HZ7U6pPDj3TokTs0AGP3D1yyCvbVdqeez3ZT/T9KvOSYIRpp38ILuS3BdebJCPaEeYj8R8Q==; 24:S8Q0MMEOyQyf5y0RyqeLVVOwRdgX3cb1XAnKGLOccvHsnihx1e28tsfqmKOqBalt8bcRIMpRuK7MiFw3YcuMr54vX3XkVD1CQOCQFRgrfvA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB044; 7:WopOxuV+y/POG+XjSKtdkJGbdYzNqF4cLlCkaUmjJB+MQWeKhNQ4h2zkFOYMefyYDxprQCeo/gpKgOBxScoQ56W8gW3rrMTnWrLiGuXHOc0TC1miMSF9gXE2TGARD+a8i8DqzoXAa5nOGkPwao7+Vf4SSiqu3kfnIBxxZc6yS52m6RJdNmx0p5M8W9CkXAJEmbJaGEgzhEG29Y4tvNgFZbHJs0ZuO2ylZtzDGb1xx8+DkrgqKRUU5AcWIslcpfDTFMwfVgTIKp+pH+M/GScWW7zZdppvP0SJi68u8lutlxCO1RC+9akE/kP78McpkbI33CxoRXF7TacOiO/p/JKxT2M3wHSuZciVvF2WoB31wyvAcm+Ja36takEq7mQaB1W7jmNXwbjkbj0BftBIdDXEpSoG/70tAZzw7eiWVo/EyW8NTEKOboVUSJxPKpGw40KE4/aw5V4zme8dxOcRRKuh8g== X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jan 2017 19:14:58.6401 (UTC) X-MS-Exchange-CrossTenant-Id: fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d; Ip=[63.163.107.21]; Helo=[milsmgep15.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR02MB044 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 On 01/23/2017 03:23 AM, Varun Prakash wrote: > This patch does not look correct to me because with this patch > seq_end_offset can get a value which is greater than IO size. Agreed. I will queue your patch. But I would appreciate if you could also review the patch below. Thanks, Bart. From: Bart Van Assche Subject: [PATCH] target/iscsi: Fix solicited data sequence offset calculations From the iSCSI RFC (https://tools.ietf.org/html/rfc7143): * MaxBurstLength is the maximum SCSI data payload in bytes in a Data-In or a solicited Data-Out iSCSI sequence. A sequence consists of one or more consecutive Data-In or Data-Out PDUs that end with a Data-In or Data-Out PDU with the F bit set to 1. * FirstBurstLength is the maximum amount in bytes of unsolicited data an iSCSI initiator may send to the target during the execution of a single SCSI command. This covers the immediate data (if any) and the sequence of unsolicited Data-Out PDUs (if any) that follow the command. Hence change the solicited data offset calculations as follows: * For the second and later Data-Out PDUs, set seq_start_offset to write_data_done instead of seq_end_offset of the previous Data-Out PDU. * For all Data-Out PDUs, limit seq_end_offset to MaxBurstLength as required by the iSCSI RFC. Signed-off-by: Bart Van Assche --- drivers/target/iscsi/iscsi_target_erl0.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/drivers/target/iscsi/iscsi_target_erl0.c b/drivers/target/iscsi/iscsi_target_erl0.c index a8bcbc43b047..f5fbcba8cbbe 100644 --- a/drivers/target/iscsi/iscsi_target_erl0.c +++ b/drivers/target/iscsi/iscsi_target_erl0.c @@ -52,20 +52,9 @@ void iscsit_set_dataout_sequence_values( if (!conn->sess->sess_ops->DataSequenceInOrder) return; - if (!cmd->seq_start_offset && !cmd->seq_end_offset) { - cmd->seq_start_offset = cmd->write_data_done; - cmd->seq_end_offset = (cmd->se_cmd.data_length > - conn->sess->sess_ops->MaxBurstLength) ? - (cmd->write_data_done + - conn->sess->sess_ops->MaxBurstLength) : cmd->se_cmd.data_length; - } else { - cmd->seq_start_offset = cmd->seq_end_offset; - cmd->seq_end_offset = ((cmd->seq_end_offset + - conn->sess->sess_ops->MaxBurstLength) >= - cmd->se_cmd.data_length) ? cmd->se_cmd.data_length : - (cmd->seq_end_offset + - conn->sess->sess_ops->MaxBurstLength); - } + cmd->seq_start_offset = cmd->write_data_done; + cmd->seq_end_offset = min(cmd->se_cmd.data_length, + conn->sess->sess_ops->MaxBurstLength); } static int iscsit_dataout_within_command_recovery_check(