From patchwork Wed Jan 25 23:36:44 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: 9538157 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 82FB86042C for ; Wed, 25 Jan 2017 23:37:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7909727F17 for ; Wed, 25 Jan 2017 23:37:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6DCA527FBB; Wed, 25 Jan 2017 23:37:31 +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 87AB827F17 for ; Wed, 25 Jan 2017 23:37:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752299AbdAYXh3 (ORCPT ); Wed, 25 Jan 2017 18:37:29 -0500 Received: from mail-bn3nam01on0065.outbound.protection.outlook.com ([104.47.33.65]:26907 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750853AbdAYXhT (ORCPT ); Wed, 25 Jan 2017 18:37:19 -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=AawGa16AHGRtepntjdPbReNS/Uvt38kvi28SQu6K5Fk=; b=oIyYKvXaaosDbhysEo3wWO2Wa8ROabWv/HeCristVRx/GB2jthbAviXW9rceO4zCis4qMgzvlxW5M7B82ivp0+DDuedIK3pQgjSceI+DmrTXSlE99R+qxneKtURaXHIouJhd3PFBP8D4dLku7ONwbfjrl5b8FrRTuKr1YYlDxRU= Received: from CY1PR0201CA0005.namprd02.prod.outlook.com (10.163.30.143) by BY2PR02MB043.namprd02.prod.outlook.com (10.242.44.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.860.13; Wed, 25 Jan 2017 23:36:57 +0000 Received: from BN1AFFO11FD016.protection.gbl (2a01:111:f400:7c10::153) by CY1PR0201CA0005.outlook.office365.com (2a01:111:e400:58b9::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.874.12 via Frontend Transport; Wed, 25 Jan 2017 23:36:57 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.21) smtp.mailfrom=sandisk.com; lst.de; dkim=none (message not signed) header.d=none;lst.de; 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 BN1AFFO11FD016.mail.protection.outlook.com (10.58.52.76) 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; Wed, 25 Jan 2017 23:36:56 +0000 Received: from MILHUBIP03.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.C8.65426.7C339885; Wed, 25 Jan 2017 15:24:55 -0800 (PST) Received: from milsmgip11.sandisk.com (10.177.8.100) by MILHUBIP03.sdcorp.global.sandisk.com (10.177.9.96) with Microsoft SMTP Server id 14.3.319.2; Wed, 25 Jan 2017 15:36:50 -0800 X-AuditID: 0ac94369-b62949800001ff92-38-588933c7258b Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id 51.45.16817.29639885; Wed, 25 Jan 2017 15:36:50 -0800 (PST) From: Bart Van Assche To: Bart Van Assche CC: , Christoph Hellwig , "Andy Grover" , David Disseldorp Subject: [PATCH 32/34] target: Move target_remove_from_state_list() into target_release_cmd_kref() Date: Wed, 25 Jan 2017 15:36:44 -0800 Message-ID: <20170125233646.2243-33-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170125233646.2243-1-bart.vanassche@sandisk.com> References: <20170125233646.2243-1-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrKLMWRmVeSWpSXmKPExsXCddJ5ke5x484Ig9+XFSz2z3rGZPH1/3QW i5WrjzJZtC59y+TA4rH7ZgObx/t9V9k8Np+u9vi8SS6AJYrLJiU1J7MstUjfLoEro3euYcE/ vooJX9cwNTAe4eli5OSQEDCRuHJrGmsXIxeHkMBSJom7V56ygiSEBHYwShxcGw1T9GjLZmaI oo2MEutn3mQGSbAJGEl8ez+TBcQWETCQ+N17gRGkiFmgg1Fifs8zsEnCAkkSa99dA2tgEVCV ePpqP1icV8Beoun5ARaIDfISu9ougsU5geKtZ3+yQFxhJ7H+QCsTyFAJgSZWiSMHf7BANAtK nJz5BMxmFpCQOPjiBTNEg7rEySXzmSYwCs1CUjYLSdkCRqZVjGK5mTnFuempBYamesWJeSmZ xdl6yfm5mxghgZ25g/HuE+9DjAIcjEo8vAJbOiKEWBPLiitzDzFKcDArifCuk+uMEOJNSays Si3Kjy8qzUktPsQozcGiJM7rdu9LmJBAemJJanZqakFqEUyWiYNTqoEx4qqC9ny306GVG743 T2wUWWKslH6k3+TL9u1LIzbuszbLXbLP3Pb80jIBY7Ebp37Ncs9wFOCb/D66cqHg2lTVZS/K 5cMNHGI3PWap4GVu/NF0v/lMoo1fZvvt3Xk/tf8EbVVm/Xq76dQBZ3X1gHPl17X4I6tL9gjX JuX78L1+/rlqit7PslwlluKMREMt5qLiRADXtN2zaAIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrKJMWRmVeSWpSXmKPExsXCtZGTTXeSWWeEQcMxTov9s54xWRz82cZo 8fX/dBaLlauPMlm0Ln3L5MDqsftmA5vH+31X2TymrTnP5LH5dLXH501yAaxRXDYpqTmZZalF +nYJXBm9cw0L/vFVTPi6hqmB8QhPFyMnh4SAicSjLZuZuxi5OIQE1jNKfPi2ggkkwSZgJPHt /UwWEFtEwEDid+8FRpAiZoEuRolNZ06xgySEBZIk1r67xgxiswioSjx9tZ8VxOYVsJe4v+gX M8QGeYldbRfB4pxA8dazP8GGCgnYSaw/0Mo0gZF7ASPDKkax3Myc4tz0zAJDQ73ixLyUzOJs veT83E2MkICI3MH4dKL5IUYmDk6pBsajdt3pd+9X1S+UZH6bam6nHmp1c8HrA3kaGQY3ewo8 gk8kepW0ugV0rZTN+63y5AJX3MxLxnEVXsvcbxaHMjHLxH3tXCJ15FXvjxb2qg7NR/efxEnl XtxVGPioJT6XvXtxswGbkfFfa7PbNSGW5826BIPnBOo/mCz2pT2e1WzCvZ1qaj7KSizFGYmG WsxFxYkAFpZd5bgBAAA= MIME-Version: 1.0 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)(39410400002)(39850400002)(39860400002)(39840400002)(39450400003)(2980300002)(438002)(189002)(199003)(68736007)(189998001)(50466002)(2950100002)(2906002)(50986999)(6200100001)(6666003)(76176999)(2270400002)(86362001)(97736004)(53936002)(1076002)(47776003)(77096006)(7049001)(33646002)(626004)(69596002)(48376002)(4326007)(38730400001)(305945005)(50226002)(110136003)(8676002)(81166006)(106466001)(356003)(81156014)(6862003)(8936002)(5003940100001)(92566002)(1691005)(5660300001)(36756003)(54906002); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR02MB043; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD016; 1:UVP1TZ1tteQUHpAfYnfOKz1ugYvvSZBQs5Qujl7r2okJ8nxiS7u9b5+VFYi9JlWvDdm+FjtzoVzbfmHtd+sQ9R4qdqRSTpKZpM0AzMgc5Ow8ZvC3KxwAZuR3iswO8I2ubTe0cP2d8xSSbd+ONkOUAI02XsZ/Gsuixl8MwGLpBoW2YE71vNEh41kd23BvoFALzVVKEfVbRgriWRdGFK39go7fDWT3RVbi/1suRB+/lXKlrDkacbVWYTdWFM+3W8PVKSD9t/uYZEM14V85YKKmEWQrk03uPOIOPKJUR2aSqnuF8qzlRDZnBKH/bd0EJSVr3XL5KDWLJ9QlB1FGsoOkGqEk1sogK8lOGdiyuNjJHCcke25GBh/byWzf9ZnJcLIa2VC5+K8qcgSp0NDyG8m/wkA23sWHysgpOVjR5fgvmtmAtFVwB5uObC9p2oSqbU+XYSsoMOblDTjtm00u8axS8sqGbgf2CkPNLKkpyOierF4/t47LyjmcBrdnqaQgxgeu X-MS-Office365-Filtering-Correlation-Id: bb95ba89-7d3c-4b7c-6dfe-08d4457b0d36 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002); SRVR:BY2PR02MB043; X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB043; 3:lWoP3SuuU53OBv1tt5tdVvE5HqehNjkh6jJYCUmBsG01qAaTnHSjk4kDX14zipAnuDQgFqWhM6rWc/Ydt4sNEMLTdsXVzIx/l62x1r46s/k21krBNUMZPVEPhsCGUWn5pUbzzBmKbq7Dw0QtUBitP1FT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W+t+ziailcQ7ldM2l9xNeO3USF0xX0JaUjkIYX8LnbLX+9Sga4nZhC71icOYQZzfe1anYKoRu9PlWjDRaa5a6ljoQJB1GNCX6uUbzq8S+L9xS4YumsR3GXKYGzU4qe8B6hjnub0Iv08y2Uu7s/1vB2hyom1NRrlR5HwrgowbMk+7tDEgcK3FF0s/XHoB0zGfOyHONjs/Xoj2fX6RstFmG64ZivMlg0APQCh24V3iEAaLVXTj9q5++sqFv8I6371p6b8pWnkPwY7ZC/rxHTRHgW++QGqaoaj1tDpRETr81e/JvhbeKRCmL4f3lIWdCPc8UMa5wmud0Q3iQzcxnKv8e/7Lg/m/+MJrTbVc13KHVlDIjLgNbRQiITGlpGNuAoYRRxibkt/YEvJm+B+QOwnfJyYMS8TBUejzSilJVQPCMI3y4ayP3azxn9cbG70GV/BaYHFAd+kbXYFvzXUUYUK4hK24TvxgZz/gy/e4Lh6N1 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:BY2PR02MB043; BCL:0; PCL:0; RULEID:; SRVR:BY2PR02MB043; X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB043; 4:a/UkQ1cPr0MU737EDw0e2X6MBFbMozz5tfNUiAs2o3q7/VbWbipa9KLzdd5jxorwcXik3K+EjdybFZALkrg+mYflj/0lnT5IifmcDIcAuiA2TJAOqk7Wp1I4tpCniO+0bE5TbMgFFCIFDWG8v02Osmya2PSdMwpcx1AeKUy49lV0xgS4MnJameOj6b6rqMym2BNBMgpRqXagOKavLaMBT2I0LzKr9dYkbdFc5J0XdB2sOiTqrKeF8Vb91GgM+qGoTZ/JJEpY+4ZkfbsdRdwoZhaFz3tGom6sO1rbD6ueEx9HmLnOht7ETc9SQh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bFhpVclhPiPdl57CzAPPV+kJT0Fc8JWcUnFjgnqLRnLOO22RWrwL0KI9rK3WF3kB6sKp2pfE8Bw== X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jan 2017 23:36:56.6523 (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: BY2PR02MB043 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 only code that iterates over the state list is the LUN reset code. Deferring removal from the state list is fine since that code grabs a reference to the command before it does any other processing. Leaving out the se_cmd.state_active test is fine because this test is already performed by target_remove_from_state_list(). Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Andy Grover Cc: David Disseldorp Reviewed-by: Hannes Reinecke --- drivers/target/target_core_transport.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index 3472dcecfb28..3f4ed4a2a160 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -588,8 +588,6 @@ static int transport_cmd_check_stop_to_fabric(struct se_cmd *cmd) { unsigned long flags; - target_remove_from_state_list(cmd); - spin_lock_irqsave(&cmd->t_state_lock, flags); /* * Determine if frontend context caller is requesting the stopping of @@ -2461,13 +2459,6 @@ int transport_generic_free_cmd(struct se_cmd *cmd, int wait_for_tasks) } else { if (wait_for_tasks) target_wait_free_cmd(cmd); - /* - * Handle WRITE failure case where transport_generic_new_cmd() - * has already added se_cmd to state_list, but fabric has - * failed command before I/O submission. - */ - if (cmd->state_active) - target_remove_from_state_list(cmd); } BUG_ON(!cmd->se_tfo); return target_put_sess_cmd(cmd); @@ -2528,6 +2519,8 @@ static void target_release_cmd_kref(struct kref *kref) struct se_session *se_sess = se_cmd->se_sess; unsigned long flags; + target_remove_from_state_list(se_cmd); + if (se_cmd->lun_ref_active) percpu_ref_put(&se_cmd->se_lun->lun_ref);