From patchwork Mon Oct 15 15:51:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10642085 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 C8BA613AD for ; Mon, 15 Oct 2018 15:52:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B8DF129A48 for ; Mon, 15 Oct 2018 15:52:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ACEAD29CA6; Mon, 15 Oct 2018 15:52:14 +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.5 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,URIBL_ABUSE_SURBL 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 540D929A48 for ; Mon, 15 Oct 2018 15:52:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726557AbeJOXiC (ORCPT ); Mon, 15 Oct 2018 19:38:02 -0400 Received: from com-out001.mailprotect.be ([83.217.72.83]:47647 "EHLO com-out001.mailprotect.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726550AbeJOXiC (ORCPT ); Mon, 15 Oct 2018 19:38:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mailprotect.be; s=mail; h=Content-Transfer-Encoding:MIME-Version:References :In-Reply-To:Message-Id:Date:Subject:Cc:To:From:reply-to:sender:bcc: content-type; bh=yRar+8x2oB5eJtnLSkCgOwPJjCiL7xUT4MdU8VQSAGM=; b=toGZyOuSVEP7 YaSSzG6ZZZfT+HXQ8pFCa4faNCmJKyNoDwAmpITB1FZGlfnG9Nmlok0wwYGCO8SC1QkpBJxLDIxmu vmF8RWVMFnS/yF8S1S99RF4Db5elq9IRzl+tHScBjXurO9xWjh1vvrYD+acZLCQ8q3EXAM77ORdgD npuapfrWPr6NdcnJcC0f+KQNKIKLWYTuJRNWdMcK6jBqUJ09FmyUI8sRcU18sTb5Rev+FT/wHuux8 7rrYFSlP+Mkyq2mh7UeVOeucfdNhe0czjUCjcRi6UX8g7QIWh+cLmUXDJi7QgEMbpRolRKVxlNTLK ktC2PTMnXgH9wsfKvH8IbQ==; Received: from smtp-auth.mailprotect.be ([178.208.39.155]) by com-mpt-out001.mailprotect.be with esmtp (Exim 4.89) (envelope-from ) id 1gC5A5-0008Fk-T5; Mon, 15 Oct 2018 17:52:06 +0200 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 14F52C06CB; Mon, 15 Oct 2018 17:51:49 +0200 (CEST) From: Bart Van Assche To: "Martin K . Petersen" Cc: Christoph Hellwig , target-devel@vger.kernel.org, Bart Van Assche , Nicholas Bellinger , Mike Christie , Hannes Reinecke Subject: [PATCH 1/6] target/core: Fix spelling in two source code comments Date: Mon, 15 Oct 2018 08:51:34 -0700 Message-Id: <20181015155139.143446-2-bvanassche@acm.org> X-Mailer: git-send-email 2.19.0.605.g01d371f741-goog In-Reply-To: <20181015155139.143446-1-bvanassche@acm.org> References: <20181015155139.143446-1-bvanassche@acm.org> 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.02) X-Recommended-Action: accept X-Filter-ID: EX5BVjFpneJeBchSMxfU5p+wrbsiDkfsjIYsgvlacJ5602E9L7XzfQH6nu9C/Fh9KJzpNe6xgvOx q3u0UDjvO1tLifGj39bI0bcPyaJsYTagCTS5H5Pie2sCQ3gGSzr06cM7U7xDGmYwNG93LVnxwxjk yGQYCd08t3lHobjxX/OigDGQOIiVUN5rGO3B5zfVpnsdsF0/474T9aStD4uEKVG9P9yTThxC66Ku Xb0HO3WlZa4xKvcBORT2AGmYYKfacHGRHPT1S45qX7/AQuG3+Xws3TRjaC42FtNJuTWwh7zLjlV5 cBkg2E15FOz6ftN7DcCVYMy/12+BkbvYY3EZ0s902MBxp+G42GIBqokZAnJ5xBHkCMCjMposz65/ e+f6NiSg6RpPztwkEB6XvRg4fu70pheH5TNN6RiG9N0Jt+0ML5i3g2GFaGQnZ3KowlU8anvoc7s0 eHtsyrH7f4vWsxE/6wnSTdYMIbg1/h42t37X7D3r+yzaf09FesHDYiVh+mW6KLAhhg63cf8hhJ+u kSXGkMRHqahP8I2z5Z6Oaau3r5afqv7IHvnvd2pvgvBc+yIcNf9mmCdHYvplLFSG4KBSfNBRSHvO tj6BxxAeW8VFuiO6yCEAclVLBw8e/TPckDkXGJvniGivX1Fq/UQDdfRWNiJbKFZUCBFMj3aVfRTy mM4V+dYvw3zgaX5MC+SYhClGQqBaLo/4e5RWTejdpMF40MajfsURz8L4dmQLKmXZ4ciB+h1c4Cwq mt5tbitpDjKIx3H3dmYdnoX9+S6u9IYxmFMhEMvBVbQbn10xsiLUL1JgezUdWQ05VsGirfnatW1x D7NPHFVkxC5YVnU16UjwG05S+hO4GQ05Y/WP30Hdn+cousT5+gFGAcOaNJ6l53AchVbc0JpeNrhF rx64zcw4Oh2LkwsmIC+tUiJAU2GWfmVpiJkOE4Udd79N8qTYZltfA464kX5xnoZz1YMFThxwEiTV JqDh0qKoKsXx5lnwVAtFIjOqBVBmDBo6d1b4QpW0dpxIo9d2WgcHzHNTu4W3OyTlA5uhTP73RN8y cSzpfj5sSQhb3cc4IkKXIhy+I6DM7/owTL8J95f1/+MXnOL6CZv+n8/wRksD+x9JjG1O+eyolGM4 l8rlxuGfhU+34hrNm42X2UZAYRVVEuFqpn0Wcxxec4eIhtK5Pi2eqhlDMrilbtDDvtO4rayUOwaR X-Report-Abuse-To: spam@com-mpt-mgt001.mailprotect.be 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 Change one occurrence of "aleady" into "already" and one occurrence of "is" into "if". Reviewed-by: Christoph Hellwig Cc: Nicholas Bellinger Cc: Mike Christie Cc: Hannes Reinecke Signed-off-by: Bart Van Assche --- drivers/target/target_core_transport.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index ac7f2d1ae2ab..468e1ca8a833 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -2012,7 +2012,7 @@ void target_execute_cmd(struct se_cmd *cmd) * Determine if frontend context caller is requesting the stopping of * this command for frontend exceptions. * - * If the received CDB has aleady been aborted stop processing it here. + * If the received CDB has already been aborted stop processing it here. */ spin_lock_irq(&cmd->t_state_lock); if (__transport_check_aborted_status(cmd, 1)) { @@ -2516,7 +2516,7 @@ transport_generic_new_cmd(struct se_cmd *cmd) } /* - * Determine is the TCM fabric module has already allocated physical + * Determine if the TCM fabric module has already allocated physical * memory, and is directly calling transport_generic_map_mem_to_cmd() * beforehand. */ From patchwork Mon Oct 15 15:51:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10642087 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 6872A13AD for ; Mon, 15 Oct 2018 15:52:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 57AAA29A48 for ; Mon, 15 Oct 2018 15:52:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4BB8229CA6; Mon, 15 Oct 2018 15:52:16 +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.5 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,URIBL_ABUSE_SURBL 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 EB6EE29A48 for ; Mon, 15 Oct 2018 15:52:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726593AbeJOXiE (ORCPT ); Mon, 15 Oct 2018 19:38:04 -0400 Received: from com-out001.mailprotect.be ([83.217.72.83]:48843 "EHLO com-out001.mailprotect.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726550AbeJOXiE (ORCPT ); Mon, 15 Oct 2018 19:38:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mailprotect.be; s=mail; h=Content-Transfer-Encoding:MIME-Version:References :In-Reply-To:Message-Id:Date:Subject:Cc:To:From:reply-to:sender:bcc: content-type; bh=cswznM9HICWpXYAeVNYtKO8BTvAb6sJhVAQSIAAqGss=; b=W84dnYePeQ3M 5S47Hav1zrTvlifl3H+E/iUrpH75UIDaJ44zG9UIbWTDxokoF+EqwvyWIUmIQNiA5iawNGI6MHw7v tuzIW6i8qNDjmGakz6fqxNMtnYzG9CBfh1lM/xwIv0nzvNJuARSusCUuJUcrxSC8TnhWKaCPcLP3T EErq6+86TalEp3nrY9TQeEIUNWr8p9XiIq1QRg+uXpKEkkkKmNT0+H/qENRxviyvwlIW/OwH5O+lk E5xSV5iTLfBGFm1iicuOzMEejLwoWZZZrXMASEXPE42un5fu7gLrGlh4vxi5RY41+Cv/tdjW58U7I eqYVBdlwkPZAcBcxOX3j9Q==; Received: from smtp-auth.mailprotect.be ([178.208.39.155]) by com-mpt-out001.mailprotect.be with esmtp (Exim 4.89) (envelope-from ) id 1gC5A8-0008H8-8C; Mon, 15 Oct 2018 17:52:08 +0200 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 E6BB1C088F; Mon, 15 Oct 2018 17:51:51 +0200 (CEST) From: Bart Van Assche To: "Martin K . Petersen" Cc: Christoph Hellwig , target-devel@vger.kernel.org, Bart Van Assche , Nicholas Bellinger , Mike Christie , Hannes Reinecke Subject: [PATCH 2/6] target/core: Remove an unused data member from struct xcopy_pt_cmd Date: Mon, 15 Oct 2018 08:51:35 -0700 Message-Id: <20181015155139.143446-3-bvanassche@acm.org> X-Mailer: git-send-email 2.19.0.605.g01d371f741-goog In-Reply-To: <20181015155139.143446-1-bvanassche@acm.org> References: <20181015155139.143446-1-bvanassche@acm.org> 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.03) X-Recommended-Action: accept X-Filter-ID: EX5BVjFpneJeBchSMxfU5nbpCkq6r2U6zzT0adBhNdR602E9L7XzfQH6nu9C/Fh9KJzpNe6xgvOx q3u0UDjvO1tLifGj39bI0bcPyaJsYTagCTS5H5Pie2sCQ3gGSzr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rilbtDDvtO4rayUOwaR X-Report-Abuse-To: spam@com-mpt-mgt001.mailprotect.be 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 A value is assigned to the xcopy_op member of struct xcopy_pt_cmd but that value is never used. Hence remove the xcopy_op member. Reviewed-by: Christoph Hellwig Cc: Nicholas Bellinger Cc: Mike Christie Cc: Hannes Reinecke Signed-off-by: Bart Van Assche --- drivers/target/target_core_xcopy.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/target/target_core_xcopy.c b/drivers/target/target_core_xcopy.c index 2718a933c0c6..70adcfdca8d1 100644 --- a/drivers/target/target_core_xcopy.c +++ b/drivers/target/target_core_xcopy.c @@ -391,7 +391,6 @@ static int target_xcopy_parse_segment_descriptors(struct se_cmd *se_cmd, struct xcopy_pt_cmd { bool remote_port; struct se_cmd se_cmd; - struct xcopy_op *xcopy_op; struct completion xpt_passthrough_sem; unsigned char sense_buffer[TRANSPORT_SENSE_BUFFER]; }; @@ -596,8 +595,6 @@ static int target_xcopy_setup_pt_cmd( * X-COPY PUSH or X-COPY PULL based upon where the CDB was received. */ target_xcopy_init_pt_lun(se_dev, cmd, remote_port); - - xpt_cmd->xcopy_op = xop; target_xcopy_setup_pt_port(xpt_cmd, xop, remote_port); cmd->tag = 0; From patchwork Mon Oct 15 15:51:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10642083 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 5873C3B73 for ; Mon, 15 Oct 2018 15:52:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 490A429A48 for ; Mon, 15 Oct 2018 15:52:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3CEEE29A4C; Mon, 15 Oct 2018 15:52:13 +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.5 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,URIBL_ABUSE_SURBL 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 E447C29D2D for ; Mon, 15 Oct 2018 15:52:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726515AbeJOXiA (ORCPT ); Mon, 15 Oct 2018 19:38:00 -0400 Received: from out002.mailprotect.be ([83.217.72.86]:41867 "EHLO out002.mailprotect.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726557AbeJOXh7 (ORCPT ); Mon, 15 Oct 2018 19:37:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mailprotect.be; s=mail; h=Content-Transfer-Encoding:MIME-Version:References :In-Reply-To:Message-Id:Date:Subject:Cc:To:From:reply-to:sender:bcc: content-type; bh=ypJQnNBfdznwlWrKZVEFW9hdqPPiIvgLDoZb0EXHk5c=; b=GNC6aS7Em2MD dVcIMawrKy/t9zvUHuL7K3dYKkouUc5FEKdJPs+nK1ucvOR24h6MPdB3tK6CdDj+vXNS/afB53tiD ZtNge2LKLPIEMyYPmFLrgf/alWUwMEUXyhN97UZgnvJzvWszw7/uZx5kMhprc7IRyG6MJsyMcrii+ uZ9BNNLtURs0VaUoh+jXTWyiUymj22qVj5FmMIv342nBOtQbdLTYOn3IJmpOVmcNZbaLjsYTk2SCy TKLTCZ20Kznig+e1gqICBcyBqmrj7iTmlsh+5MC3SkYT5TkV9anjNszb9HCBsEu1yOvh1iNGqHGR/ 5shQewimQbLwgiUjGS4MFQ==; Received: from smtp-auth.mailprotect.be ([178.208.39.155]) by com-mpt-out002.mailprotect.be with esmtp (Exim 4.89) (envelope-from ) id 1gC5A2-0009Xp-CH; Mon, 15 Oct 2018 17:52:03 +0200 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 A3FCBC0A4D; Mon, 15 Oct 2018 17:51:53 +0200 (CEST) From: Bart Van Assche To: "Martin K . Petersen" Cc: Christoph Hellwig , target-devel@vger.kernel.org, Bart Van Assche , Nicholas Bellinger , Mike Christie , Hannes Reinecke Subject: [PATCH 3/6] target/core: Remove the SCF_COMPARE_AND_WRITE_POST flag Date: Mon, 15 Oct 2018 08:51:36 -0700 Message-Id: <20181015155139.143446-4-bvanassche@acm.org> X-Mailer: git-send-email 2.19.0.605.g01d371f741-goog In-Reply-To: <20181015155139.143446-1-bvanassche@acm.org> References: <20181015155139.143446-1-bvanassche@acm.org> 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.03) X-Recommended-Action: accept X-Filter-ID: EX5BVjFpneJeBchSMxfU5hzHtcFiJa06ohiXCXv39CN602E9L7XzfQH6nu9C/Fh9KJzpNe6xgvOx q3u0UDjvO1tLifGj39bI0bcPyaJsYTagCTS5H5Pie2sCQ3gGSzr06cM7U7xDGmYwNG93LVnxwxjk yGQYCd08t3lHobjxX/OigDGQOIiVUN5rGO3B5zfVpnsdsF0/474T9aStD4uEKVG9P9yTThxC66Ku Xb0HO3WlZa4xKvcBORT2AGmYYKfacHGRHPT1S45qX7/AQuG3+Xws3TRjaC42FtNJuTWwh7zLjlV5 cBkg2E15FOz6ftN79i75W4x5csPOIuAA23CVYc902MBxp+G42GIBqokZAnJ5xBHkCMCjMposz65/ e+f6sz9VtXrOJenZ5zYaF/sdP+70pheH5TNN6RiG9N0Jt+0ML5i3g2GFaGQnZ3KowlU8anvoc7s0 eHtsyrH7f4vWsxE/6wnSTdYMIbg1/h42t37X7D3r+yzaf09FesHDYiVh+mW6KLAhhg63cf8hhJ+u kSXGkMRHqahP8I2z5Z6Oaau3r5afqv7IHvnvd2pvgvBc+yIcNf9mmCdHYvplLFSG4KBSfNBRSHvO tj6BxxAeW8VFuiO6yCEAclVLBw8e/TPckDkXGJvniGivX1Fq/UQDdfRWNiJbKFZUCBFMj3aVfRTy mM4V+dYvw3zgaX5MC+SYhClGQqBaLo/4e5RWTejdpMF40MajfsURz8L4dmQLKmXZ4ciB+h1c4Cwq mt5tbitpbYxvJ34ZFW/Nsw5JzXRzZN/ikV9jw84fBBX1DO528i7UL1JgezUdWQ05VsGirfnatW1x D7NPHFVkxC5YVnU16UjwG05S+hO4GQ05Y/WP30Hdn+cousT5+gFGAcOaNJ6l53AchVbc0JpeNrhF rx64zcw4Oh2LkwsmIC+tUiJAU2GWfmVpiJkOE4Udd79N8qTYYxTI82mpOPXOi/+eVvRjMBxwEiTV JqDh0qKoKsXx5lnwVAtFIjOqBVBmDBo6d1b4QpW0dpxIo9d2WgcHzHNTu4W3OyTlA5uhTP73RN8y cSzpfj5sSQhb3cc4IkKXIhy+I6DM7/owTL8J95f1/+MXnOL6CZv+n8/wRksD+x9JjG1O+eyolGM4 l8rlxuGfhU+34hrNm42X2UZAYRVVEuFqpn0Wcxxec4eIhtK5Pi2eqhlDMrilbtDDvtO4rayUOwaR X-Report-Abuse-To: spam@com-mpt-mgt001.mailprotect.be 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 Commit 057085e522f8 ("target: Fix race for SCF_COMPARE_AND_WRITE_POST checking") removed the code that checks the SCF_COMPARE_AND_WRITE_POST flag. Hence also remove the flag itself. Cc: Nicholas Bellinger Cc: Mike Christie Cc: Christoph Hellwig Cc: Hannes Reinecke Signed-off-by: Bart Van Assche --- drivers/target/target_core_sbc.c | 6 ------ include/target/target_core_base.h | 1 - 2 files changed, 7 deletions(-) diff --git a/drivers/target/target_core_sbc.c b/drivers/target/target_core_sbc.c index ebac2b49b9c6..f2c3b67dbb36 100644 --- a/drivers/target/target_core_sbc.c +++ b/drivers/target/target_core_sbc.c @@ -425,14 +425,8 @@ static sense_reason_t compare_and_write_post(struct se_cmd *cmd, bool success, struct se_device *dev = cmd->se_dev; sense_reason_t ret = TCM_NO_SENSE; - /* - * Only set SCF_COMPARE_AND_WRITE_POST to force a response fall-through - * within target_complete_ok_work() if the command was successfully - * sent to the backend driver. - */ spin_lock_irq(&cmd->t_state_lock); if (cmd->transport_state & CMD_T_SENT) { - cmd->se_cmd_flags |= SCF_COMPARE_AND_WRITE_POST; *post_ret = 1; if (cmd->scsi_status == SAM_STAT_CHECK_CONDITION) diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h index 7a4ee7852ca4..e3bdb0550a59 100644 --- a/include/target/target_core_base.h +++ b/include/target/target_core_base.h @@ -138,7 +138,6 @@ enum se_cmd_flags_table { SCF_ALUA_NON_OPTIMIZED = 0x00008000, SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC = 0x00020000, SCF_COMPARE_AND_WRITE = 0x00080000, - SCF_COMPARE_AND_WRITE_POST = 0x00100000, SCF_PASSTHROUGH_PROT_SG_TO_MEM_NOALLOC = 0x00200000, SCF_ACK_KREF = 0x00400000, SCF_USE_CPUID = 0x00800000, From patchwork Mon Oct 15 15:51:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10642089 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 6193D13AD for ; Mon, 15 Oct 2018 15:52:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 50D7E29A48 for ; Mon, 15 Oct 2018 15:52:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 44D8529CA6; Mon, 15 Oct 2018 15:52:26 +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.5 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,URIBL_ABUSE_SURBL 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 DAFF829A48 for ; Mon, 15 Oct 2018 15:52:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726594AbeJOXiO (ORCPT ); Mon, 15 Oct 2018 19:38:14 -0400 Received: from com-out001.mailprotect.be ([83.217.72.83]:59083 "EHLO com-out001.mailprotect.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726550AbeJOXiO (ORCPT ); Mon, 15 Oct 2018 19:38:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mailprotect.be; s=mail; h=Content-Transfer-Encoding:MIME-Version:References :In-Reply-To:Message-Id:Date:Subject:Cc:To:From:reply-to:sender:bcc: content-type; bh=ztY5JGRMwM9QE02iXyPZOBfitZH3Um4NHsLSqI62FBo=; b=m3paPikqYRck FrunzX6zaRZkWnuUQ/PaiMQfxgFn78PYapL9h6DlCmhZueH9hMmteigq0XrDQrkK4EhAFfSILuPdv 553QLbPJviONxKdT1M2j79RjBYMQLGOGrx8x2Bm87P8s5OZCWewL6ZEskz5riTGiHQW04ljZrvFtB qWYYccxWVbNUBblIfabUQnBt+zpwGkAxo3JQfr2sY3P08qvHwKpSVkVyhF0V00Pw04+yqUfh4sAdj 7GdoWxK94QCK/3OXGNtFiLDD6QNfP6JAvIeBtGqZaqFXOOZUzmpjhtf1G040EOw7ar5m8BBforR57 nBAOgA3CTNPYuHt32xMnxQ==; Received: from smtp-auth.mailprotect.be ([178.208.39.155]) by com-mpt-out001.mailprotect.be with esmtp (Exim 4.89) (envelope-from ) id 1gC5AB-0008Hq-Sj; Mon, 15 Oct 2018 17:52:12 +0200 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 7BE77C0ADA; Mon, 15 Oct 2018 17:51:55 +0200 (CEST) From: Bart Van Assche To: "Martin K . Petersen" Cc: Christoph Hellwig , target-devel@vger.kernel.org, Bart Van Assche , Nicholas Bellinger , Mike Christie , Hannes Reinecke Subject: [PATCH 4/6] target/core: Use the SECTOR_SHIFT constant Date: Mon, 15 Oct 2018 08:51:37 -0700 Message-Id: <20181015155139.143446-5-bvanassche@acm.org> X-Mailer: git-send-email 2.19.0.605.g01d371f741-goog In-Reply-To: <20181015155139.143446-1-bvanassche@acm.org> References: <20181015155139.143446-1-bvanassche@acm.org> 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.01) X-Recommended-Action: accept X-Filter-ID: EX5BVjFpneJeBchSMxfU5t2Kji55NwYd+bKIqkH7++N602E9L7XzfQH6nu9C/Fh9KJzpNe6xgvOx q3u0UDj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2UZAYRVVEuFqpn0Wcxxec4eIhtK5Pi2eqhlDMrilbtDDvtO4rayUOwaR X-Report-Abuse-To: spam@com-mpt-mgt001.mailprotect.be 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 Instead of duplicating the SECTOR_SHIFT definition from , use it. This patch does not change any functionality. Reviewed-by: Christoph Hellwig Cc: Nicholas Bellinger Cc: Mike Christie Cc: Hannes Reinecke Signed-off-by: Bart Van Assche --- drivers/target/target_core_iblock.c | 4 ++-- drivers/target/target_core_iblock.h | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c index ce1321a5cb7b..1bc9b14236d8 100644 --- a/drivers/target/target_core_iblock.c +++ b/drivers/target/target_core_iblock.c @@ -514,7 +514,7 @@ iblock_execute_write_same(struct se_cmd *cmd) } /* Always in 512 byte units for Linux/Block */ - block_lba += sg->length >> IBLOCK_LBA_SHIFT; + block_lba += sg->length >> SECTOR_SHIFT; sectors -= 1; } @@ -757,7 +757,7 @@ iblock_execute_rw(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents, } /* Always in 512 byte units for Linux/Block */ - block_lba += sg->length >> IBLOCK_LBA_SHIFT; + block_lba += sg->length >> SECTOR_SHIFT; sg_num--; } diff --git a/drivers/target/target_core_iblock.h b/drivers/target/target_core_iblock.h index 9cc3843404d4..cefc641145b3 100644 --- a/drivers/target/target_core_iblock.h +++ b/drivers/target/target_core_iblock.h @@ -9,7 +9,6 @@ #define IBLOCK_VERSION "4.0" #define IBLOCK_MAX_CDBS 16 -#define IBLOCK_LBA_SHIFT 9 struct iblock_req { refcount_t pending; From patchwork Mon Oct 15 15:51:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10642081 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 2E27A13AD for ; Mon, 15 Oct 2018 15:52:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1C94729A48 for ; Mon, 15 Oct 2018 15:52:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 10CEF29CA6; Mon, 15 Oct 2018 15:52:13 +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.5 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,URIBL_ABUSE_SURBL 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 139C729A48 for ; Mon, 15 Oct 2018 15:52:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726585AbeJOXh7 (ORCPT ); Mon, 15 Oct 2018 19:37:59 -0400 Received: from out002.mailprotect.be ([83.217.72.86]:41775 "EHLO out002.mailprotect.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726576AbeJOXh7 (ORCPT ); Mon, 15 Oct 2018 19:37:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mailprotect.be; s=mail; h=Content-Transfer-Encoding:MIME-Version:References :In-Reply-To:Message-Id:Date:Subject:Cc:To:From:reply-to:sender:bcc: content-type; bh=cfnth46fkpiAwEEs8aKfdchLZ/1GiWjSHDnRA6p9Pks=; b=oEnJM5PbgbYg MVNzCcBOuWGpguFb3JaKwRWnTyTyLW7c3vlzs797Y9vNryFPIyADYLIxHAAJiDazo+PiZgAaTpVDh 2M6dpcYFSNy5DYsOo+vuuVGXkbjCMidOaKYQGHkLZYEl+yTZmADxgbxOBQ5wck4qi/Gev8DWiwXKK qG9UCMPWnHokYkEQ9D3EVZTkm0pU1sv1p51HdO8ksQ/M8x9whcFIG1M/F+P14tc8yjhGCVXy0Loba trxFkn3Za5vw63ti3PS4IeH74xNeVbC28O+zHQMUxw0S5XJr/Ex7AzibjP8nWp90OpPnJgQ/cRcYR gIkV7B8lPg0zGWreoc74VQ==; Received: from smtp-auth.mailprotect.be ([178.208.39.155]) by com-mpt-out002.mailprotect.be with esmtp (Exim 4.89) (envelope-from ) id 1gC5A2-0009WV-J8; Mon, 15 Oct 2018 17:52:03 +0200 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 568DBC0715; Mon, 15 Oct 2018 17:51:57 +0200 (CEST) From: Bart Van Assche To: "Martin K . Petersen" Cc: Christoph Hellwig , target-devel@vger.kernel.org, Bart Van Assche , Nicholas Bellinger , Mike Christie , Hannes Reinecke Subject: [PATCH 5/6] target/core: Use sg_alloc_table() instead of open-coding it Date: Mon, 15 Oct 2018 08:51:38 -0700 Message-Id: <20181015155139.143446-6-bvanassche@acm.org> X-Mailer: git-send-email 2.19.0.605.g01d371f741-goog In-Reply-To: <20181015155139.143446-1-bvanassche@acm.org> References: <20181015155139.143446-1-bvanassche@acm.org> 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.07) X-Recommended-Action: accept X-Filter-ID: EX5BVjFpneJeBchSMxfU5uolIl9XG89crp4Cz3EhDeJ602E9L7XzfQH6nu9C/Fh9KJzp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8rlxuGfhU+34hrNm42X2UZAYRVVEuFqpn0Wcxxec4eIhtK5Pi2eqhlDMrilbtDDvtO4rayUOwaR X-Report-Abuse-To: spam@com-mpt-mgt001.mailprotect.be 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 The purpose of sg_alloc_table() is to allocate and initialize an sg-list. Use that function instead of open-coding it. This patch will make it easier to share code for caching sg-list allocations between the SCSI and NVMe target cores. Signed-off-by: Bart Van Assche Cc: Nicholas Bellinger Cc: Mike Christie Cc: Christoph Hellwig Cc: Hannes Reinecke --- drivers/target/target_core_sbc.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/target/target_core_sbc.c b/drivers/target/target_core_sbc.c index f2c3b67dbb36..3d3568a037b1 100644 --- a/drivers/target/target_core_sbc.c +++ b/drivers/target/target_core_sbc.c @@ -447,7 +447,8 @@ static sense_reason_t compare_and_write_callback(struct se_cmd *cmd, bool succes int *post_ret) { struct se_device *dev = cmd->se_dev; - struct scatterlist *write_sg = NULL, *sg; + struct sg_table write_tbl = { }; + struct scatterlist *write_sg, *sg; unsigned char *buf = NULL, *addr; struct sg_mapping_iter m; unsigned int offset = 0, len; @@ -488,14 +489,12 @@ static sense_reason_t compare_and_write_callback(struct se_cmd *cmd, bool succes goto out; } - write_sg = kmalloc_array(cmd->t_data_nents, sizeof(*write_sg), - GFP_KERNEL); - if (!write_sg) { + if (sg_alloc_table(&write_tbl, cmd->t_data_nents, GFP_KERNEL) < 0) { pr_err("Unable to allocate compare_and_write sg\n"); ret = TCM_OUT_OF_RESOURCES; goto out; } - sg_init_table(write_sg, cmd->t_data_nents); + write_sg = write_tbl.sgl; /* * Setup verify and write data payloads from total NumberLBAs. */ @@ -591,7 +590,7 @@ static sense_reason_t compare_and_write_callback(struct se_cmd *cmd, bool succes * sbc_compare_and_write() before the original READ I/O submission. */ up(&dev->caw_sem); - kfree(write_sg); + sg_free_table(&write_tbl); kfree(buf); return ret; } From patchwork Mon Oct 15 15:51:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10642079 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 70D983B73 for ; Mon, 15 Oct 2018 15:52:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 60F4229A4C for ; Mon, 15 Oct 2018 15:52:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5560D29D92; Mon, 15 Oct 2018 15:52:12 +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.5 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,URIBL_ABUSE_SURBL 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 77F4329CA6 for ; Mon, 15 Oct 2018 15:52:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726545AbeJOXh7 (ORCPT ); Mon, 15 Oct 2018 19:37:59 -0400 Received: from out002.mailprotect.be ([83.217.72.86]:48693 "EHLO out002.mailprotect.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726515AbeJOXh7 (ORCPT ); Mon, 15 Oct 2018 19:37:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mailprotect.be; s=mail; h=Content-Transfer-Encoding:MIME-Version:References :In-Reply-To:Message-Id:Date:Subject:Cc:To:From:reply-to:sender:bcc: content-type; bh=VmhE8a1Ub9+jmf57qPAvBzT51QApbEbY8COOL3fvbYU=; b=kR1fcAE2Kq5g 2apXvvuXtGFpyLvI829k8xxZHzq2WxdpBXz2kLeeTwbXxe6cL7Ri9fiWeCVoSIqrsfX60FyUbG0nI BtvC89npJFRY0pAqU4EMxk8bG7Ir9GyQG3YgKqpX6JdFzd9jUr2GIKyu28dB3tICimxccEVPA3ODj 4c1uOJUye/ubajUnR21qAB9+EOrvnAomJcsabZzse1xyGLlJALqFHiu7b4mT13rZryTTP0piENecS tS784ffVKieg0E7wDErpq17RfUmXBKk0FxnK+gCVRhIdr/RGj+JnxEMVhlD1YetrOOdPc6tFQPgeE IZdz6lI3cL5+wgG67/9Npw==; Received: from smtp-auth.mailprotect.be ([178.208.39.155]) by com-mpt-out002.mailprotect.be with esmtp (Exim 4.89) (envelope-from ) id 1gC5A2-0009b2-CH; Mon, 15 Oct 2018 17:52:03 +0200 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 1129CC07A1; Mon, 15 Oct 2018 17:51:58 +0200 (CEST) From: Bart Van Assche To: "Martin K . Petersen" Cc: Christoph Hellwig , target-devel@vger.kernel.org, Bart Van Assche , Mike Christie , Hannes Reinecke Subject: [PATCH 6/6] target/core: Always call transport_complete_callback() upon failure Date: Mon, 15 Oct 2018 08:51:39 -0700 Message-Id: <20181015155139.143446-7-bvanassche@acm.org> X-Mailer: git-send-email 2.19.0.605.g01d371f741-goog In-Reply-To: <20181015155139.143446-1-bvanassche@acm.org> References: <20181015155139.143446-1-bvanassche@acm.org> 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: EX5BVjFpneJeBchSMxfU5kboLPPZTEWeJPUWZ6AtwUZ602E9L7XzfQH6nu9C/Fh9KJzpNe6xgvOx q3u0UDjvO1tLifGj39bI0bcPyaJsYTZxu3Byt9q6TVKuEvuKfBQ+aWdYlCowlUnTo3UbachR40Zf fE0usZyS6PgIMmbCO3gkbdGM+jggbhZjfwa/Ogn5Zys6RYhY2imAj2+fF1Ma8Omxdr9OC1XUrlfa OmQB6e65e8jXa/Ea2gAgBrec9tAizcnIJmV/EOrG3jtoSDbBLR5e973vehgRRMJdd1x498Q6aSop 1VmFdzKki3Lf0Py0Ucju/Fd8gZoUQm8ysuFdGDBATaXJi7Z4ZhS731MYRsQSQWn9OYmU74xfbcEY ge/fQ5V1w/lQDKmwNbTAZ3E5Dpk5mH/X3pSH/ENJb2CQDcu/XzAMt/0PABq6TVaYjnpbxmD/2Y9v Q6c+CWRhbvYX853D5caUhbVtvqItBqoizkEQpFMpOnK2cKmSUffE8iapT1zD59o8cPYKs494BBiY WZpnLXKSPjmKiZZGO+roBKKdSCGABwb9D8aK2Qif5uut31/E3ahF5MMcDI7KdpjQKRG0HOT5ecYO CZkoygoA2+QvP92yJqFDUMWgYkYfhC80REDgvLPPYwYvrULndIB5QrNud3PgzKGZ88iododq/YfV WMlHoWh7YJ70YBk8N5yx6J1fhOzjF0b4LXcjJZ5louxf6ne4pHVivVmY0wtE7rIy3/265IZaBaHy RxFyhirgEkb9AHldeYfDeuTlPTdQ+5LPfRlCCIyI0Yv3ypBAHZjiWAj99Mzwr0GLDMEFW1nETrlU kMKWpoTN4DsyS5wnPuol7Ms2nAH/0jNlDiiCinvKATDDBZ7fFc0FDw0l2bg+jkeExOUtS7k2YYS4 3XpVG7T16L20XLidvZ59Qh6JHQkATIzNr/1fYV+w9TGWHEuebwN0BCkzBb1FgeZJe7aTin5mKiWY 4qyAovTKsLgKiJpsYzB6zs3Ie5gF1CN3Vi14kybNYmBNw2nvSnaifocwwtEyvDkN3AfUBddcu9g0 UhyhLJoDVPNCkw0HFsHtEuJgAFHDO1LA3rllvVAfaoz9P82wWVbjHO/cpJpsYlvFhM9OFv+pmyo5 sRDJ3Ba4degLD9XCJ1j3Qs4VUPN7CTHyu+z6MAWK52wAXqk3taVJ+IE= X-Report-Abuse-To: spam@com-mpt-mgt001.mailprotect.be 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 COMPARE AND WRITE command execution starts with a call of sbc_compare_and_write(). That function locks the caw_sem member in the backend device data structure and submits a read request to the backend driver. Upon successful completion of the read compare_and_write_callback() gets called. That last function compares the data that has been read. If it matches transport_complete_callback is set to compare_and_write_post and a write request is submitted. compare_and_write_post() submits a write request to the backend driver. XDWRITEREAD command execution starts with sbc_execute_rw() submitting a read to the backend device. Upon successful completion of the read the xdreadwrite_callback() gets called. That function xors the data that has been read with the data in the data-out buffer and stores the result in the data-in buffer. Call transport_complete_callback() not only if COMPARE AND WRITE fails but also if XDWRITEREAD fails. This makes the code more systematic. Make sure that the callback functions handle (cmd, false, NULL) argument triples fine. Reviewed-by: Christoph Hellwig Reviewed-by: Nicholas Bellinger Cc: Mike Christie Cc: Hannes Reinecke Signed-off-by: Bart Van Assche --- drivers/target/target_core_sbc.c | 6 +++++- drivers/target/target_core_transport.c | 11 +++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/target/target_core_sbc.c b/drivers/target/target_core_sbc.c index 3d3568a037b1..1ac1f7d2e6c9 100644 --- a/drivers/target/target_core_sbc.c +++ b/drivers/target/target_core_sbc.c @@ -360,6 +360,10 @@ static sense_reason_t xdreadwrite_callback(struct se_cmd *cmd, bool success, unsigned int offset; sense_reason_t ret = TCM_NO_SENSE; int i, count; + + if (!success) + return 0; + /* * From sbc3r22.pdf section 5.48 XDWRITEREAD (10) command * @@ -426,7 +430,7 @@ static sense_reason_t compare_and_write_post(struct se_cmd *cmd, bool success, sense_reason_t ret = TCM_NO_SENSE; spin_lock_irq(&cmd->t_state_lock); - if (cmd->transport_state & CMD_T_SENT) { + if (success) { *post_ret = 1; if (cmd->scsi_status == SAM_STAT_CHECK_CONDITION) diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index 468e1ca8a833..f66d7a03c651 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -1778,7 +1778,7 @@ EXPORT_SYMBOL(target_submit_tmr); void transport_generic_request_failure(struct se_cmd *cmd, sense_reason_t sense_reason) { - int ret = 0, post_ret = 0; + int ret = 0; pr_debug("-----[ Storage Engine Exception; sense_reason %d\n", sense_reason); @@ -1789,13 +1789,8 @@ void transport_generic_request_failure(struct se_cmd *cmd, */ transport_complete_task_attr(cmd); - /* - * Handle special case for COMPARE_AND_WRITE failure, where the - * callback is expected to drop the per device ->caw_sem. - */ - if ((cmd->se_cmd_flags & SCF_COMPARE_AND_WRITE) && - cmd->transport_complete_callback) - cmd->transport_complete_callback(cmd, false, &post_ret); + if (cmd->transport_complete_callback) + cmd->transport_complete_callback(cmd, false, NULL); if (transport_check_aborted_status(cmd, 1)) return;