From patchwork Wed Jan 23 19:10:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10777745 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9D4F46C2 for ; Wed, 23 Jan 2019 19:10:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8DBFC2DA9A for ; Wed, 23 Jan 2019 19:10:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 824602DA9C; Wed, 23 Jan 2019 19:10:33 +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=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,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 209AA2DA9E for ; Wed, 23 Jan 2019 19:10:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726365AbfAWTKc (ORCPT ); Wed, 23 Jan 2019 14:10:32 -0500 Received: from com-out001.mailprotect.be ([83.217.72.83]:46663 "EHLO com-out001.mailprotect.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726124AbfAWTKc (ORCPT ); Wed, 23 Jan 2019 14:10:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mailprotect.be; s=mail; h=Content-Transfer-Encoding:MIME-Version:Message-Id :Date:Subject:Cc:To:From:reply-to:sender:bcc:in-reply-to:references: content-type; bh=LdVqD9q3B1cswhJLKY5q69Zz6X4d8PDy88TQAiLOeAw=; b=n9HiBcxc75Qr W16ithoMh6Zvr0jdHMzbP8oKfD0Z8sCpdJ8zNFbufmmzpKfJrEzau4BVcz/OiWFemiFjiZKXvX1It tT3ewNg1GrReliEubShPGP+/KQfMiQZj3PZ0QKUh6tQM6ve+zeVob7T03KSgF8Dg0DDSmAd65dh0t dI5CN457H/ItkAHxkk/MIRaMOPxl1n3C5HDrbb5YzvUvwiqOJSdjJmDswxjm9zcalX7PEjPmI7Xll FrxnmrizbdNKVTCqyB1F0NlhEWr3cIINwC0e+8e0jXpj4+EhRc8XAVgFZ/OqyMwrPeMHfE2nyFic7 gIZZiWHopO2Z0sgU9n7utg==; Received: from smtp-auth.mailprotect.be ([178.208.39.155]) by com-mpt-out001.mailprotect.be with esmtp (Exim 4.89) (envelope-from ) id 1gmNur-0000Ye-HF; Wed, 23 Jan 2019 20:10:26 +0100 Received: from desktop-bart.svl.corp.google.com (unknown [104.133.8.89]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-auth.mailprotect.be (Postfix) with ESMTPSA id CC867C06CF; Wed, 23 Jan 2019 20:10:20 +0100 (CET) From: Bart Van Assche To: "Martin K . Petersen" , "James E . J . Bottomley" Cc: linux-scsi@vger.kernel.org, Bart Van Assche Subject: [PATCH v2 0/7] Fix handling of bidi commands Date: Wed, 23 Jan 2019 11:10:06 -0800 Message-Id: <20190123191013.119684-1-bvanassche@acm.org> X-Mailer: git-send-email 2.20.1.321.g9e740568ce-goog MIME-Version: 1.0 X-Originating-IP: 178.208.39.155 X-SpamExperts-Domain: mailprotect.be X-SpamExperts-Username: 178.208.39.128/27 Authentication-Results: mailprotect.be; auth=pass smtp.auth=178.208.39.128/27@mailprotect.be X-SpamExperts-Outgoing-Class: ham X-SpamExperts-Outgoing-Evidence: Combined (0.05) X-Recommended-Action: accept X-Filter-ID: EX5BVjFpneJeBchSMxfU5mNoZyabAlAQhrzPEZllt3F602E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mG8yXCcEbxT2UdIuHji9IodMg2vu WMdu+65sFAzW X-Report-Abuse-To: spam@com-mpt-mgt001.mailprotect.be Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi Martin, Recently Doug Gilbert reported that handling of bidi commands is broken in the scsi-mq code. This patch series fixes that bug and also simplifies bidi command handling. Please consider these patches for kernel v5.1. Thanks, Bart. Changes compared to v1: - Fixed a NULL pointer dereference in scsi_init_sdb(). Bart Van Assche (7): Introduce the bidi_supported flag in the host template structure Change scsi_cmnd.prot_sdb from a pointer into a regular member Fix bidi handling Introduce scsi_out_cmd() Move several function definitions in Introduce scsi_in_[sg]et_resid() and scsi_out_[sg]et_resid() Move the resid member from struct scsi_data_buffer into struct scsi_cmnd drivers/scsi/iscsi_tcp.c | 8 +--- drivers/scsi/libiscsi.c | 12 ++--- drivers/scsi/scsi_debug.c | 20 +++------ drivers/scsi/scsi_lib.c | 70 ++++++++++++------------------ drivers/scsi/sd.c | 4 +- drivers/scsi/virtio_scsi.c | 4 +- drivers/target/loopback/tcm_loop.c | 8 +--- drivers/usb/storage/uas.c | 8 ++-- include/scsi/scsi_cmnd.h | 67 ++++++++++++++++++++-------- include/scsi/scsi_host.h | 2 + 10 files changed, 101 insertions(+), 102 deletions(-)