Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752061Ab3HTU0D (ORCPT ); Tue, 20 Aug 2013 16:26:03 -0400 Received: from mail-oa0-f43.google.com ([209.85.219.43]:52716 "EHLO mail-oa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751937Ab3HTUYD (ORCPT ); Tue, 20 Aug 2013 16:24:03 -0400 From: "Nicholas A. Bellinger" To: target-devel Cc: lkml , linux-scsi , Christoph Hellwig , Hannes Reinecke , Martin Petersen , Chris Mason , James Bottomley , Nicholas Bellinger , Nicholas Bellinger Subject: [PATCH 5/9] target: Skip ->queue_data_in() callbacks for COMPARE_AND_WRITE Date: Tue, 20 Aug 2013 20:07:56 +0000 Message-Id: <1377029280-19144-6-git-send-email-nab@daterainc.com> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1377029280-19144-1-git-send-email-nab@daterainc.com> References: <1377029280-19144-1-git-send-email-nab@daterainc.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1997 Lines: 53 From: Nicholas Bellinger COMPARE_AND_WRITE uses cmd->t_bidi_data_sg for it's READ payload and cmd->data_direction == DMA_TO_DEVICE, but the payload is only used for internal comparision, and never actually sent over the wire. So, check for this special case in to avoid TFO->queue_data_in() within transport_complete_qf() + target_complete_ok_work() code. Cc: Christoph Hellwig Cc: Hannes Reinecke Cc: Martin Petersen Cc: Chris Mason Cc: James Bottomley Cc: Nicholas Bellinger Signed-off-by: Nicholas Bellinger --- drivers/target/target_core_transport.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index f7dc479..60d1336 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -1832,7 +1832,8 @@ static void transport_complete_qf(struct se_cmd *cmd) ret = cmd->se_tfo->queue_data_in(cmd); break; case DMA_TO_DEVICE: - if (cmd->t_bidi_data_sg) { + if (cmd->t_bidi_data_sg && + cmd->t_task_cdb[0] != COMPARE_AND_WRITE) { ret = cmd->se_tfo->queue_data_in(cmd); if (ret < 0) break; @@ -1947,7 +1948,8 @@ static void target_complete_ok_work(struct work_struct *work) /* * Check if we need to send READ payload for BIDI-COMMAND */ - if (cmd->t_bidi_data_sg) { + if (cmd->t_bidi_data_sg && + cmd->t_task_cdb[0] != COMPARE_AND_WRITE) { spin_lock(&cmd->se_lun->lun_sep_lock); if (cmd->se_lun->lun_sep) { cmd->se_lun->lun_sep->sep_stats.tx_data_octets += -- 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/