From patchwork Sat Jan 30 07:05:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nicholas A. Bellinger" X-Patchwork-Id: 8169951 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 3A24E9FBF9 for ; Sat, 30 Jan 2016 07:09:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6267D20395 for ; Sat, 30 Jan 2016 07:09:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8021520397 for ; Sat, 30 Jan 2016 07:09:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756278AbcA3HJW (ORCPT ); Sat, 30 Jan 2016 02:09:22 -0500 Received: from mail-ob0-f171.google.com ([209.85.214.171]:34925 "EHLO mail-ob0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755696AbcA3HJI (ORCPT ); Sat, 30 Jan 2016 02:09:08 -0500 Received: by mail-ob0-f171.google.com with SMTP id ny8so59665564obc.2 for ; Fri, 29 Jan 2016 23:09:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daterainc-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=tvrYZpS5/i55NLjQSobXjRCl+zG9qOgXvh4Fy+68k7Y=; b=pvuEYiNXoyzhKo3a7ho+w94yZAKAMtwoWxQtp25vTKmbr4cO/9I9yOkgGS4wtAuTJm NlDEOy71Pvsc3tPPhBxdgj8SvpFklmRs6oOp1zobDM7SsLVpe9+y2kxA2xGdWKHPuiX5 bzQy1dK4xj9P3eANQu/joBwqv+7aGPG53LzxbxGXR6H7C7C3mxcyziY07AkSp8Hu0yrM UepJljr+horvrIlGbUajzC+vaadLkrJVxa3IcDgGkC/b0KkZx7aKlcOXSxW1EHxhUmJx DsU+HZdg3bqTP0c/XWHv7SZ72wth3g1Ntnr1cctf0f9eynCqqezpyv+CN1/nVxbB57NJ Y6cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=tvrYZpS5/i55NLjQSobXjRCl+zG9qOgXvh4Fy+68k7Y=; b=kR2dkkXqXBLiLQEGTOYFAhK80TQOtVvL5SDfjHP/luvz9QbHvxsTVlI43IjaWXDhsy 1ZqB/EvT6v9I7LqB+AjGp3J5OGlhvxV40cm5YAEjUbAx0Upb5qDaXPUUZgsrQL1KlmYF bP8ls68vavPxOTxg/bKioKseQNq4/EtPUiQJAcWYiQoBwf+aKbIuzbn1MQLWwJuu+Gk5 b09pcgdh/aTZtEfE5s2fNi6PFMivG1aaSLulP3DdZqTisBao/QSa/+Nxcls7F8NGgGlA vJPtqWSkIhZj2gbffCphAC4KPACKpHXPx5XcWfavwYQwLsKS/zy1NCKUVZN8IYH96NVP 9/HA== X-Gm-Message-State: AG10YORqpTqy68aI7pgdsplPqtqQIdegmYyYE45DPqEd0RotOIdlBOWhKp20OftWiK2lUQ== X-Received: by 10.182.142.105 with SMTP id rv9mr10299192obb.66.1454137746355; Fri, 29 Jan 2016 23:09:06 -0800 (PST) Received: from localhost.localdomain (mail.linux-iscsi.org. [67.23.28.174]) by smtp.gmail.com with ESMTPSA id f8sm8655678obs.3.2016.01.29.23.09.05 (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 29 Jan 2016 23:09:05 -0800 (PST) From: "Nicholas A. Bellinger" To: target-devel Cc: linux-scsi , Christoph Hellwig , Hannes Reinecke , Mike Christie , Sagi Grimberg , Andy Grover , Sebastian Andrzej Siewior , Juergen Gross , Andrzej Pietrasiewicz , Chris Boot , Nicholas Bellinger , Vasu Dev Subject: [PATCH-v3 13/14] tcm_fc: Convert to TARGET_SCF_ACK_KREF I/O + TMR krefs Date: Sat, 30 Jan 2016 07:05:57 +0000 Message-Id: <1454137558-30396-14-git-send-email-nab@daterainc.com> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1454137558-30396-1-git-send-email-nab@daterainc.com> References: <1454137558-30396-1-git-send-email-nab@daterainc.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Nicholas Bellinger Cc: Vasu Dev Signed-off-by: Nicholas Bellinger --- drivers/target/tcm_fc/tfc_cmd.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/target/tcm_fc/tfc_cmd.c b/drivers/target/tcm_fc/tfc_cmd.c index 064d6df..768aec3 100644 --- a/drivers/target/tcm_fc/tfc_cmd.c +++ b/drivers/target/tcm_fc/tfc_cmd.c @@ -107,8 +107,7 @@ void ft_release_cmd(struct se_cmd *se_cmd) int ft_check_stop_free(struct se_cmd *se_cmd) { - transport_generic_free_cmd(se_cmd, 0); - return 1; + return transport_generic_free_cmd(se_cmd, 0); } /* @@ -179,6 +178,12 @@ int ft_queue_status(struct se_cmd *se_cmd) return -ENOMEM; } lport->tt.exch_done(cmd->seq); + /* + * Drop the extra ACK_KREF reference taken by target_submit_cmd() + * ahead of ft_check_stop_free() -> transport_generic_free_cmd() + * final se_cmd->cmd_kref put. + */ + target_put_sess_cmd(&cmd->se_cmd); return 0; } @@ -422,6 +427,12 @@ void ft_queue_tm_resp(struct se_cmd *se_cmd) pr_debug("tmr fn %d resp %d fcp code %d\n", tmr->function, tmr->response, code); ft_send_resp_code(cmd, code); + /* + * Drop the extra ACK_KREF reference taken by target_submit_tmr() + * ahead of ft_check_stop_free() -> transport_generic_free_cmd() + * final se_cmd->cmd_kref put. + */ + target_put_sess_cmd(&cmd->se_cmd); } void ft_aborted_task(struct se_cmd *se_cmd)