From patchwork Wed Jan 25 23:36:46 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: 9538153 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 DB1066042C for ; Wed, 25 Jan 2017 23:37:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D121427F17 for ; Wed, 25 Jan 2017 23:37:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C615527FBC; Wed, 25 Jan 2017 23:37:29 +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 C9D8527FB0 for ; Wed, 25 Jan 2017 23:37:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752268AbdAYXh2 (ORCPT ); Wed, 25 Jan 2017 18:37:28 -0500 Received: from mail-by2nam03on0087.outbound.protection.outlook.com ([104.47.42.87]:15104 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751737AbdAYXhP (ORCPT ); Wed, 25 Jan 2017 18:37:15 -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=jaytHeUSv/p/Ll2IGbpQIWBcbowK8mYZaeZ5PyHeEQc=; b=ddC9UY+R7a75MZdky0ks9jkUrDpRetVZ/fxxx6+yBKSO0L3wTS/kYiet6EcMwtO/eG6DWEniUbH0ngp+PH02+mKRtI4ARjssgrAf9QQ2Jmjrilb8B8BISp3882C96gjNC35WVzmSNUqCq2BJrQ+Jn+OBELKdOGs9An8xIAU83ns= Received: from BN6PR02CA0031.namprd02.prod.outlook.com (10.173.146.145) by CY1PR02MB1413.namprd02.prod.outlook.com (10.161.171.15) 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:58 +0000 Received: from BL2FFO11FD052.protection.gbl (2a01:111:f400:7c09::139) by BN6PR02CA0031.outlook.office365.com (2603:10b6:404:5f::17) 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 BL2FFO11FD052.mail.protection.outlook.com (10.173.161.214) 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:57 +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 FD.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-39-588933c784d4 Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id 12.45.16817.29639885; Wed, 25 Jan 2017 15:36:50 -0800 (PST) From: Bart Van Assche To: Bart Van Assche CC: , Christoph Hellwig , "David Disseldorp" Subject: [PATCH 34/34] target: Avoid that XCOPY commands trigger a deadlock Date: Wed, 25 Jan 2017 15:36:46 -0800 Message-ID: <20170125233646.2243-35-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+NgFjrJLMWRmVeSWpSXmKPExsXCddJ5ke5x484Ig+6lGhZf/09nsVi5+iiT RevSt0wOzB67bzaweWw+Xe3xeZNcAHMUl01Kak5mWWqRvl0CV8bqX0vZCvZaV5z8fZO5gfGL cRcjJ4eEgInE6dmzGUFsIYGlTBLLtilA2DsYJQ6ujYapOfXlM1ANF1B8I6NE3/FJbCAJNgEj iW/vZ7KA2CICBhK/ey+ADWIWSJO4v/0nE4gtLOAtsbXpL1Ccg4NFQFVi330ekDCvgL3EiRev mSDmy0vsarvICmJzAsVbz/5kgbjBTmL9gVYmkL0SAp9YJDY1rmWHaBaUODnzCQvELgmJgy9e MEM0qEucXDKfaQKj0CwkZbOQlC1gZFrFKJabmVOcm55aYGiqV5yYl5JZnK2XnJ+7iRESwJk7 GO8+8T7EKMDBqMTDK7ClI0KINbGsuDL3EKMEB7OSCO86uc4IId6UxMqq1KL8+KLSnNTiQ4zS HCxK4rxu976ECQmkJ5akZqemFqQWwWSZODilGhg7j23blHRym+W74OWLm9skfjffDBbOP3zF +4N9kVFX+ydus53nU01C+0MeXlvlInm3+8XHRQ4Zdrr5TGyTrntaG2vMm/PjP5/E/jJ54+rO fzFHhCsM9aU+/1x/5XdZeDEL80NB9lUNpwNUqg0ObjQ1ZJosMqVD6Jz0g5W9kdPmGasLrMw+ cEiJpTgj0VCLuag4EQBB2Z40XAIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprJJMWRmVeSWpSXmKPExsXCtZGTTXeSWWeEwduD3BYHf7YxWnz9P53F YuXqo0wWrUvfMjmweOy+2cDmMW3NeSaPzaerPT5vkgtgieKySUnNySxLLdK3S+DKWP1rKVvB XuuKk79vMjcwfjHuYuTkkBAwkTj15TMjiC0ksJ5R4tZlARCbTcBI4tv7mSwgtoiAgcTv3gtg NcwCaRJXP1xjBbGFBbwltjb9BYpzcLAIqErsu88DEuYVsJeY1dnKBDFeXmJX20Wwck6geOvZ nywQq+wk1h9oZZrAyL2AkWEVo1huZk5xbnpmgaGhXnFiXkpmcbZecn7uJkaI5yN3MD6daH6I kYmDU6qBUX/P5tvL7onp8C6o5AwSNPt1nq/373ejwuXpJxV7nnaLf55qe37fbdbVv9+0JsfP 5bStmNSR3XuOZ2ne7rYtG4ufXqj+HfN93fZtUpz7L9yaKm5ccuK0r/xe8y93vmVeD5lb/bBz 3b3aST98O1LaTIUDfFkPfFt6PFZ984yzd5uPi/RrF3EGSSixFGckGmoxFxUnAgCPcuXvrAEA AA== 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)(39450400003)(39860400002)(39840400002)(39410400002)(39850400002)(2980300002)(438002)(199003)(189002)(2950100002)(77096006)(6666003)(53936002)(76176999)(6862003)(97736004)(1076002)(106466001)(110136003)(4326007)(5003940100001)(86362001)(50986999)(189998001)(38730400001)(6200100001)(54906002)(2906002)(81156014)(2270400002)(7049001)(92566002)(48376002)(5660300001)(1691005)(69596002)(8936002)(36756003)(50466002)(33646002)(50226002)(305945005)(8676002)(626004)(68736007)(81166006)(47776003)(356003); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR02MB1413; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD052; 1:5Qv384OCigMX/YzFoQF2NoTFpAj6+vugI2jdrwNw1QhyJus4G+eXiuq/GX7zJWOTT+39NGSm3oWSntKO7LoyH2IxNW8dblLWGm0gNuE0iD5Mzn39LXosIRDdcs3oM4vPgsu7n4DVklepICM0BaqZmPNJVTcHn3Fj6xK5/ywtAPDCgrCOVziRpynb4KoVgSgiXcI1iMVsBrZNFao/PZBKgBZi8hy69a0+DURakjuwIoaraUnySuYyd6lv0WRFr/vmS03uv1RnW7mt6PlLfWvKQgWNJGq1rSuZe2jA5U8SCyUQ2zsDn0koRBgq+Xn1QkB162SP63ORqXGO+n76faVQaR3YxVXSCOVrrMeAug2xP5Z3uwLSAyPDCwpqVZsoh539NUIfjkg+CxRW6FFUWo/bIJzFHHvi4jXYIoYekQ84uQqkxl+29U1JgN+hxV1dCjoDHlgNRwQ9SQWINQmaB27zTBj2LOD1woQnC9u/hc4nPls6GPODwo9eSl7T673yAbyK X-MS-Office365-Filtering-Correlation-Id: 04874d9b-c99b-402d-b5dc-08d4457b0d69 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002); SRVR:CY1PR02MB1413; X-Microsoft-Exchange-Diagnostics: 1; CY1PR02MB1413; 3:LESuhL2xPtPahM8G1WAc3zJYUmlmeVvrKHmsYtw2jvEZYAmbYSfQQ6t/uhuvJhymDOhOKYrcOEyhFJ84aUKBY0TXaVKIxVuLpwAi9u9pVdMSPNak5Vs1DCaT46119fLz6bYBSah0uRqtYowozMyPT67o33vjvTO0cK4naIWTadpE34o4cWPxIwBlPY7ifa62dVcqeOz05KGh3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EWga4QXzDWj8cAH4UIuFPw60Le07bchewlKO8lJGO/o9gaQ/8gSIPfVP8PdK+k2/ZHPvtobLfJKz2e/PsH0IwKX9MGOmWZt0A1SGyH1l9kMLWN5kf1xZE16Krti3enHit9yqEdeZCXVGdIcBXsHI/BrYCBwVdvJdZtakXLS7ie2YbvYROOC/R3Oq9wYK5bLA7FTHrowLQ7w1NXx708E7NyNUHzhbXvKJxX0ovbOsac95wJ7uL76zSRJQ5LdXLTifLtXRxGs8tHYzoAtycGjUb1IH7w8p7KQJ1OmakN; 20:TEWo4yDfBp9y0AkCtZrDSrdKC30EwydECw8JLD4yg5GEA1Fpx/oyj87LU1b7kq7jrkqWoXNWUbhrmx+oSc41nAGW1InzD4r889p3XXnQmhIanHZVCAMg3/naAgJKAwWoucXwBHnC6zIMFiAohvuweXej4KyjhJSqbQQnLrzsXMRBWof1NSBgWOUUdfAhgoZKkN5sC2m4A2SpTHGzAqIJ11ftZoiIoVe0JDFLByxrEaK4nzcbU+HNaWXbtvLDrXdot+uEF/xcxk6uIcRvnj3tIgSz55s9QQK8e/MZzMWvLP4Nlbz9mJnLEWCGkatS4uyS1xrPmnZkTWr8SxezjeVSTQEg7d7uPaeyDYxNaxak7Vn0tizruJWj6zMO9stnwKqnicGiSEk4bLnTbBeb4H81FZ3GimOCcncbFa3O6hf48o1qhSs2Gzt5BwimPSXf4PYEdZq8R+1UDD62V3qzJDM9IXNwKdT2dIGseBMb9S9nMEToZ8HYVLc4LaO6TwX2KotP X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(20558992708506)(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(13016025)(13018025)(5005006)(8121501046)(3002001)(10201501046)(6055026)(6041248)(20161123562025)(20161123555025)(20161123560025)(20161123564025)(6072148); SRVR:CY1PR02MB1413; BCL:0; PCL:0; RULEID:; SRVR:CY1PR02MB1413; X-Microsoft-Exchange-Diagnostics: 1;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lre9imKuj8vDmZNIyiCsJlxLUCrWa9?= =?us-ascii?Q?+h7obC3uWeHOTutganUun/xIOqqN4xS7Kym0ejQ7x2CyB8B53cKOaBiSxDAS?= =?us-ascii?Q?OR8sHE5Rie5KkzBfLTxV88HtclpL7ph2LyB0yRlhGViCdfBR08Svn7LKQ=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR02MB1413; 6:z8yMZmlI2VpRnEJ+hkMizLTL76E1/+4fEwwaq/2kSbLSp4sqqG4rIYrgwdKgpGhltdqvMt3Xmkp5Jl59AWdSSF4uE/+GPrTjHfZojxfj1cpxcWVaa0JQfdF88TIxx5iTeg2i8dci1Vox1pft6LzFV9TsvWSWhGRGEFK/CthflMNERjymbl6m51dNZzps5kFkVhV8vSPtsbLbW8zvlSVleah0k+ggUKJeuazxWEZb7SG0MZu8LNN80De5piU7vzQu2jGS7YxTqNNSmRVTGT0saEKJa9ZyKh6vISJ2Jo4GHOP7Ct8PphN2reWI/atbrWv7N/w0EQmwNI2rdXNo3S+Kol9UgNNq8visHu8c9sibGEZTKzDOW7g29crAZN41CgIlkInRur6rQ1cmvmEovFa9F6t2GXiVJxmS+pUzlRKiy1l7FAy6kyUEC4ASdfJoq3vf0/MoxLHvWeskv7YVc3QxRw==; 5:+fariTPXfvuKDGqjLmDptjJ9S885KvQ1iWLKkLZH8HYGv/HGYg/GN/+GDQpA5u5t7lq/i/t1ckI5XgOK9I/8ArY+WB/lCy4QGeib6xG1aJzgeaGf2cjA/KIglhmKZvGCZ/4+r6KLAiraouPOtTSxCQ==; 24:JQllwbJdjDmU/XWmwneePrkUWm681FlfTQv+1Xhz8c1PZzZGgLf389DlY8+sIn349Bm3HmDbfKAFq1SSZS/Fen33rFyJSLf8p+kqgaDVPtI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR02MB1413; 7:aubMUSCxWlh2Uc4wUiNW2HHLznVbojtjcm+xCDcKNJDafdn1+ftV2b7OVdhGwVNBXxnRbt4M44nL1ZhHChspaTQGjr1oBQ2nHkntzBROsC0mUKoN0ON998tIFVqaYiHQVd5w1pE0WpZyMNkNxPaVimRVTKwDlzoBgy3FzbyxE0bVPTIx4vrJcF/Gl3u2HRHNlcTi7d9rjn7sgZXnu/qonI9BxzcTRDbe+f1+EqG84jdVCDz0I7qQTSYaryRoO+YriqQNEWTy7+lAgXcO16qCnNGWK4IjQSooGvJSwbCatv8rLAu4rwOPQWgdHJMH6xMWbTU8tw9LbZgOYo86zKevkNN4JUp+hoXvopGZmsXYhvnsij9HDE0nC2mQoMjQeiRn76w5pSFV/TNbpisdtJJ42LrfDOhW7neZnihyTQp/IGosB0zVTRheSWJrxQP0xIYAHAlhW7d+6wS/p+dwddRrEQ== X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jan 2017 23:36:57.0508 (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: CY1PR02MB1413 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 Move the target_depend_item() call out of the critical section. This patch avoids that lockdep reports the following: Reviewed-by: Hannes Reinecke ====================================================== [ INFO: possible circular locking dependency detected ] 4.10.0-rc4-debug+ #1 Not tainted ------------------------------------------------------- rmdir/1799 is trying to acquire lock: (&sess->cmdsn_mutex){+.+.+.}, at: [] iscsit_free_all_ooo_cmdsns+0x2d/0xb0 [iscsi_target_mod] but task is already holding lock: (&sb->s_type->i_mutex_key#15){++++++}, at: [] vfs_rmdir+0x50/0x140 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&sb->s_type->i_mutex_key#15){++++++}: [] lock_acquire+0x71/0x90 [] down_write+0x3f/0x70 [] configfs_depend_item+0x3a/0xb0 [configfs] [] target_depend_item+0x13/0x20 [target_core_mod] [] target_xcopy_locate_se_dev_e4+0xdb/0x1a0 [target_core_mod] [] target_do_xcopy+0x31c/0x8b0 [target_core_mod] [] __target_execute_cmd+0x22/0xa0 [target_core_mod] [] target_execute_cmd.part.20+0x1e9/0x290 [target_core_mod] [] target_execute_cmd+0x13/0x20 [target_core_mod] [] iscsit_execute_cmd+0x1d2/0x230 [iscsi_target_mod] [] iscsit_sequence_cmd+0x10b/0x190 [iscsi_target_mod] [] iscsit_get_rx_pdu+0x37d/0xcd0 [iscsi_target_mod] [] iscsi_target_rx_thread+0x6e/0xa0 [iscsi_target_mod] [] kthread+0x102/0x140 [] ret_from_fork+0x31/0x40 -> #1 (g_device_mutex){+.+...}: [] lock_acquire+0x71/0x90 [] mutex_lock_nested+0x5f/0x670 [] target_xcopy_locate_se_dev_e4+0x23/0x1a0 [target_core_mod] [] target_do_xcopy+0x31c/0x8b0 [target_core_mod] [] __target_execute_cmd+0x22/0xa0 [target_core_mod] [] target_execute_cmd.part.20+0x1e9/0x290 [target_core_mod] [] target_execute_cmd+0x13/0x20 [target_core_mod] [] iscsit_execute_cmd+0x1d2/0x230 [iscsi_target_mod] [] iscsit_sequence_cmd+0x10b/0x190 [iscsi_target_mod] [] iscsit_get_rx_pdu+0x37d/0xcd0 [iscsi_target_mod] [] iscsi_target_rx_thread+0x6e/0xa0 [iscsi_target_mod] [] kthread+0x102/0x140 [] ret_from_fork+0x31/0x40 -> #0 (&sess->cmdsn_mutex){+.+.+.}: [] __lock_acquire+0x10e6/0x1260 [] lock_acquire+0x71/0x90 [] mutex_lock_nested+0x5f/0x670 [] iscsit_free_all_ooo_cmdsns+0x2d/0xb0 [iscsi_target_mod] [] iscsit_close_session+0xac/0x200 [iscsi_target_mod] [] lio_tpg_close_session+0x9f/0xb0 [iscsi_target_mod] [] target_shutdown_sessions+0xc3/0xd0 [target_core_mod] [] core_tpg_del_initiator_node_acl+0x91/0x140 [target_core_mod] [] target_fabric_nacl_base_release+0x20/0x30 [target_core_mod] [] config_item_release+0x5a/0xc0 [configfs] [] config_item_put+0x1d/0x1f [configfs] [] configfs_rmdir+0x1a6/0x300 [configfs] [] vfs_rmdir+0xb7/0x140 [] do_rmdir+0x1f4/0x200 [] SyS_rmdir+0x11/0x20 [] entry_SYSCALL_64_fastpath+0x23/0xc6 other info that might help us debug this: Chain exists of: &sess->cmdsn_mutex --> g_device_mutex --> &sb->s_type->i_mutex_key#15 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&sb->s_type->i_mutex_key#15); lock(g_device_mutex); lock(&sb->s_type->i_mutex_key#15); lock(&sess->cmdsn_mutex); *** DEADLOCK *** 3 locks held by rmdir/1799: #0: (sb_writers#10){.+.+.+}, at: [] mnt_want_write+0x1f/0x50 #1: (&default_group_class[depth - 1]#2/1){+.+.+.}, at: [] do_rmdir+0x15e/0x200 #2: (&sb->s_type->i_mutex_key#15){++++++}, at: [] vfs_rmdir+0x50/0x140 stack backtrace: CPU: 1 PID: 1799 Comm: rmdir Not tainted 4.10.0-rc4-debug+ #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.9.1-0-gb3ef39f-prebuilt.qemu-project.org 04/01/2014 Call Trace: dump_stack+0x86/0xc3 print_circular_bug+0x1c7/0x220 __lock_acquire+0x10e6/0x1260 lock_acquire+0x71/0x90 mutex_lock_nested+0x5f/0x670 iscsit_free_all_ooo_cmdsns+0x2d/0xb0 [iscsi_target_mod] iscsit_close_session+0xac/0x200 [iscsi_target_mod] lio_tpg_close_session+0x9f/0xb0 [iscsi_target_mod] target_shutdown_sessions+0xc3/0xd0 [target_core_mod] core_tpg_del_initiator_node_acl+0x91/0x140 [target_core_mod] target_fabric_nacl_base_release+0x20/0x30 [target_core_mod] config_item_release+0x5a/0xc0 [configfs] config_item_put+0x1d/0x1f [configfs] configfs_rmdir+0x1a6/0x300 [configfs] vfs_rmdir+0xb7/0x140 do_rmdir+0x1f4/0x200 SyS_rmdir+0x11/0x20 entry_SYSCALL_64_fastpath+0x23/0xc6 Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: David Disseldorp --- drivers/target/target_core_xcopy.c | 40 ++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/drivers/target/target_core_xcopy.c b/drivers/target/target_core_xcopy.c index 180d8d718db5..760a19c5b516 100644 --- a/drivers/target/target_core_xcopy.c +++ b/drivers/target/target_core_xcopy.c @@ -58,7 +58,7 @@ static int target_xcopy_locate_se_dev_e4(const unsigned char *dev_wwn, { struct se_device *se_dev; unsigned char tmp_dev_wwn[XCOPY_NAA_IEEE_REGEX_LEN]; - int rc; + int rc = -1; mutex_lock(&g_device_mutex); list_for_each_entry(se_dev, &g_device_list, g_dev_node) { @@ -73,28 +73,30 @@ static int target_xcopy_locate_se_dev_e4(const unsigned char *dev_wwn, if (rc != 0) continue; - *found_dev = se_dev; - pr_debug("XCOPY 0xe4: located se_dev: %p\n", se_dev); + target_get_device(se_dev); + break; + } + mutex_unlock(&g_device_mutex); - rc = target_depend_item(&se_dev->dev_group.cg_item); - if (rc != 0) { - pr_err("configfs_depend_item attempt failed:" - " %d for se_dev: %p\n", rc, se_dev); - mutex_unlock(&g_device_mutex); - return rc; - } + if (rc != 0) { + pr_debug_ratelimited("Unable to locate 0xe4 descriptor for EXTENDED_COPY\n"); + return -EINVAL; + } - pr_debug("Called configfs_depend_item for se_dev: %p" - " se_dev->se_dev_group: %p\n", se_dev, - &se_dev->dev_group); + *found_dev = se_dev; + pr_debug("XCOPY 0xe4: located se_dev: %p\n", se_dev); - mutex_unlock(&g_device_mutex); - return 0; - } - mutex_unlock(&g_device_mutex); + rc = target_depend_item(&se_dev->dev_group.cg_item); + if (rc != 0) + pr_err("configfs_depend_item attempt failed: %d for se_dev: %p\n", + rc, se_dev); + else + pr_debug("Called configfs_depend_item for se_dev: %p se_dev->se_dev_group: %p\n", + se_dev, &se_dev->dev_group); - pr_debug_ratelimited("Unable to locate 0xe4 descriptor for EXTENDED_COPY\n"); - return -EINVAL; + target_put_device(se_dev); + + return rc; } static int target_xcopy_parse_tiddesc_e4(struct se_cmd *se_cmd, struct xcopy_op *xop,