Message ID | 20231218153105.12717-16-dwagner@suse.de |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-4031-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp1354036dyi; Mon, 18 Dec 2023 08:15:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IGPm1CqKiakf85kFhYLDNO9Il4o5DKq1MoHJIZbg3MJ8QMMtkhpglwiC5KyVFntzEnFDLn1 X-Received: by 2002:a50:ee97:0:b0:553:45b6:5c10 with SMTP id f23-20020a50ee97000000b0055345b65c10mr1592357edr.45.1702916118958; Mon, 18 Dec 2023 08:15:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702916118; cv=none; d=google.com; s=arc-20160816; b=UITzFDmN269MwY1FjYybgo4CBFMgY8fKbBlIwtF7QQIFM6h85PRMJ0CpX+ECRPpDbA DJuI2B7OLEMHTC5bRwqsCu3Oz2k36AKpcfq6PKcUNGH1SZTI5Eh0gC3z0lUiSUbfnSSP zqyuRlRczge4p6uT1f9GU21YI0F4QanpLcHDBcGOG2XoVMjiG/jACm8sFycsqoMpmcST Py1vYdGRMWClsD2Cfzyba2Z1yoxPvHT0WYJ/qHr+5/T/srKgQt7kuAq+5RewUd3qQntU ryizKh8ZoordTT3vF2hGgEClIA8zn8eD53l2ho9Feu8ixHQF0uA58UgAvk4pFsmgo7Fh 17Lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature:dkim-signature :dkim-signature:dkim-signature; bh=yK/Hr2YVEMCcXE4FG2IGAGx0ZBAT/0fwQl0qaqUb0zc=; fh=3QIVKsEmsld8rvcEkMSr/XDw53o2lrGJeYcvS7FhzFk=; b=vKFGRL3gM+F5J8qAvtgbpY2VMS5MTnNSaGSNCs/HYm7w7woqbdq6GEcait9BO8u5o7 adYA+HtD2/KkGQlUWQN89BkhOfsQuMW6RZ8E1Zq6Z3ZRnyNgQxZEtaikhtAOlG7oDWUT 5uqvouyHUH+kEIoI56OXU87VXUPkEG0xIDOwThOzy974ZnL8gMJ2qg3f32mlBYifXVEr HJZxA5VAyZia5psInx0UfI7nyJg6tlCnONDz+g/Wgeff/0/vV59dJ5q60UgogKYxazyy 3p3W4hFbu3bUcgs6PY9wJHsPY5nVqFUfxEyJsDVSMSWT6vszc4u9YeN3CLZ2EADZuCl9 39nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=G1v6op6O; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=cS5EfduT; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=G1v6op6O; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=cS5EfduT; spf=pass (google.com: domain of linux-kernel+bounces-4031-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4031-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id m22-20020a509316000000b0054c838a8cdasi10126117eda.535.2023.12.18.08.15.18 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 08:15:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-4031-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=G1v6op6O; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=cS5EfduT; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=G1v6op6O; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=cS5EfduT; spf=pass (google.com: domain of linux-kernel+bounces-4031-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4031-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 065C61F2560E for <ouuuleilei@gmail.com>; Mon, 18 Dec 2023 16:09:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AE76C5BF88; Mon, 18 Dec 2023 16:07:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="G1v6op6O"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="cS5EfduT"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="G1v6op6O"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="cS5EfduT" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4A6025A84C for <linux-kernel@vger.kernel.org>; Mon, 18 Dec 2023 16:07:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [10.150.64.98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 6538121FDD; Mon, 18 Dec 2023 16:07:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1702915640; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yK/Hr2YVEMCcXE4FG2IGAGx0ZBAT/0fwQl0qaqUb0zc=; b=G1v6op6ObibyZR/C0rZ28xAdfORhVbzUByAxvkvgs3dQ/32JZ6nXo6j4WkrGfU+XrOyLO5 PuifE0PrxHlh5UPnMko3qpBhplWb+6z5wVJ93Wlnem2ttO2LTjX9Sn/URtMoWENQDbAtdC ZN5xib6UQxzl4+L/ZMjLGpfU7ovJTu0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1702915640; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yK/Hr2YVEMCcXE4FG2IGAGx0ZBAT/0fwQl0qaqUb0zc=; b=cS5EfduT2suNMErc3P2c4ho5D3m2AxJAY1ovUmq63jD5Nl/xloZj3qMBT8OJFtwpFPPqb1 2a8arXTTU0wmlUAQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1702915640; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yK/Hr2YVEMCcXE4FG2IGAGx0ZBAT/0fwQl0qaqUb0zc=; b=G1v6op6ObibyZR/C0rZ28xAdfORhVbzUByAxvkvgs3dQ/32JZ6nXo6j4WkrGfU+XrOyLO5 PuifE0PrxHlh5UPnMko3qpBhplWb+6z5wVJ93Wlnem2ttO2LTjX9Sn/URtMoWENQDbAtdC ZN5xib6UQxzl4+L/ZMjLGpfU7ovJTu0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1702915640; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yK/Hr2YVEMCcXE4FG2IGAGx0ZBAT/0fwQl0qaqUb0zc=; b=cS5EfduT2suNMErc3P2c4ho5D3m2AxJAY1ovUmq63jD5Nl/xloZj3qMBT8OJFtwpFPPqb1 2a8arXTTU0wmlUAQ== Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id 4EAA713BD5; Mon, 18 Dec 2023 16:07:20 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id vYlJEThugGVcBAAAn2gu4w (envelope-from <dwagner@suse.de>); Mon, 18 Dec 2023 16:07:20 +0000 From: Daniel Wagner <dwagner@suse.de> To: linux-nvme@lists.infradead.org Cc: linux-kernel@vger.kernel.org, Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>, Keith Busch <kbusch@kernel.org>, James Smart <james.smart@broadcom.com>, Hannes Reinecke <hare@suse.de>, Daniel Wagner <dwagner@suse.de> Subject: [PATCH v3 15/16] nvmet-fc: avoid deadlock on delete association path Date: Mon, 18 Dec 2023 16:31:03 +0100 Message-ID: <20231218153105.12717-16-dwagner@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231218153105.12717-1-dwagner@suse.de> References: <20231218153105.12717-1-dwagner@suse.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Authentication-Results: smtp-out1.suse.de; none X-Spam-Level: ** X-Spam-Score: 2.21 X-Spamd-Result: default: False [2.21 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; NEURAL_SPAM_SHORT(2.37)[0.789]; REPLY(-4.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RCPT_COUNT_SEVEN(0.00)[8]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.06)[60.96%] X-Spam-Flag: NO X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785636972011887352 X-GMAIL-MSGID: 1785636972011887352 |
Series |
enable nvmet-fc for blktests
|
|
Commit Message
Daniel Wagner
Dec. 18, 2023, 3:31 p.m. UTC
When deleting an association the shutdown path is deadlocking because we
try to flush the nvmet_wq nested. Avoid this by deadlock by deferring
the put work into its own work item.
Signed-off-by: Daniel Wagner <dwagner@suse.de>
---
drivers/nvme/target/fc.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
Comments
Hi Daniel, kernel test robot noticed the following build errors: [auto build test ERROR on linux-nvme/nvme-6.8] [also build test ERROR on linus/master v6.7-rc6 next-20231218] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Daniel-Wagner/nvmet-fc-remove-unnecessary-bracket/20231219-003117 base: git://git.infradead.org/nvme.git nvme-6.8 patch link: https://lore.kernel.org/r/20231218153105.12717-16-dwagner%40suse.de patch subject: [PATCH v3 15/16] nvmet-fc: avoid deadlock on delete association path config: x86_64-rhel-8.3-rust (https://download.01.org/0day-ci/archive/20231219/202312191347.7X0VJgnV-lkp@intel.com/config) compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231219/202312191347.7X0VJgnV-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202312191347.7X0VJgnV-lkp@intel.com/ All errors (new ones prefixed by >>): >> drivers/nvme/target/fc.c:253:2: error: call to undeclared function 'nvmet_fc_tgtport_put'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] nvmet_fc_tgtport_put(tgtport); ^ >> drivers/nvme/target/fc.c:259:13: error: static declaration of 'nvmet_fc_tgtport_put' follows non-static declaration static void nvmet_fc_tgtport_put(struct nvmet_fc_tgtport *tgtport); ^ drivers/nvme/target/fc.c:253:2: note: previous implicit declaration is here nvmet_fc_tgtport_put(tgtport); ^ 2 errors generated. vim +/nvmet_fc_tgtport_put +253 drivers/nvme/target/fc.c 244 245 246 static void nvmet_fc_handle_ls_rqst_work(struct work_struct *work); 247 static void nvmet_fc_fcp_rqst_op_defer_work(struct work_struct *work); 248 static void nvmet_fc_put_tgtport_work(struct work_struct *work) 249 { 250 struct nvmet_fc_tgtport *tgtport = 251 container_of(work, struct nvmet_fc_tgtport, put_work); 252 > 253 nvmet_fc_tgtport_put(tgtport); 254 } 255 static void nvmet_fc_tgt_a_put(struct nvmet_fc_tgt_assoc *assoc); 256 static int nvmet_fc_tgt_a_get(struct nvmet_fc_tgt_assoc *assoc); 257 static void nvmet_fc_tgt_q_put(struct nvmet_fc_tgt_queue *queue); 258 static int nvmet_fc_tgt_q_get(struct nvmet_fc_tgt_queue *queue); > 259 static void nvmet_fc_tgtport_put(struct nvmet_fc_tgtport *tgtport); 260 static int nvmet_fc_tgtport_get(struct nvmet_fc_tgtport *tgtport); 261 static void nvmet_fc_handle_fcp_rqst(struct nvmet_fc_tgtport *tgtport, 262 struct nvmet_fc_fcp_iod *fod); 263 static void nvmet_fc_delete_target_assoc(struct nvmet_fc_tgt_assoc *assoc); 264 static void nvmet_fc_xmt_ls_rsp(struct nvmet_fc_tgtport *tgtport, 265 struct nvmet_fc_ls_iod *iod); 266 267
Hi Daniel, kernel test robot noticed the following build errors: [auto build test ERROR on linux-nvme/nvme-6.8] [also build test ERROR on linus/master v6.7-rc6 next-20231219] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Daniel-Wagner/nvmet-fc-remove-unnecessary-bracket/20231219-003117 base: git://git.infradead.org/nvme.git nvme-6.8 patch link: https://lore.kernel.org/r/20231218153105.12717-16-dwagner%40suse.de patch subject: [PATCH v3 15/16] nvmet-fc: avoid deadlock on delete association path config: loongarch-defconfig (https://download.01.org/0day-ci/archive/20231219/202312191634.ASof5mm8-lkp@intel.com/config) compiler: loongarch64-linux-gcc (GCC) 13.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231219/202312191634.ASof5mm8-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202312191634.ASof5mm8-lkp@intel.com/ All error/warnings (new ones prefixed by >>): drivers/nvme/target/fc.c: In function 'nvmet_fc_put_tgtport_work': >> drivers/nvme/target/fc.c:253:9: error: implicit declaration of function 'nvmet_fc_tgtport_put'; did you mean 'nvmet_ctrl_put'? [-Werror=implicit-function-declaration] 253 | nvmet_fc_tgtport_put(tgtport); | ^~~~~~~~~~~~~~~~~~~~ | nvmet_ctrl_put drivers/nvme/target/fc.c: At top level: >> drivers/nvme/target/fc.c:259:13: warning: conflicting types for 'nvmet_fc_tgtport_put'; have 'void(struct nvmet_fc_tgtport *)' 259 | static void nvmet_fc_tgtport_put(struct nvmet_fc_tgtport *tgtport); | ^~~~~~~~~~~~~~~~~~~~ drivers/nvme/target/fc.c:259:13: error: static declaration of 'nvmet_fc_tgtport_put' follows non-static declaration drivers/nvme/target/fc.c:253:9: note: previous implicit declaration of 'nvmet_fc_tgtport_put' with type 'void(struct nvmet_fc_tgtport *)' 253 | nvmet_fc_tgtport_put(tgtport); | ^~~~~~~~~~~~~~~~~~~~ cc1: some warnings being treated as errors vim +253 drivers/nvme/target/fc.c 244 245 246 static void nvmet_fc_handle_ls_rqst_work(struct work_struct *work); 247 static void nvmet_fc_fcp_rqst_op_defer_work(struct work_struct *work); 248 static void nvmet_fc_put_tgtport_work(struct work_struct *work) 249 { 250 struct nvmet_fc_tgtport *tgtport = 251 container_of(work, struct nvmet_fc_tgtport, put_work); 252 > 253 nvmet_fc_tgtport_put(tgtport); 254 } 255 static void nvmet_fc_tgt_a_put(struct nvmet_fc_tgt_assoc *assoc); 256 static int nvmet_fc_tgt_a_get(struct nvmet_fc_tgt_assoc *assoc); 257 static void nvmet_fc_tgt_q_put(struct nvmet_fc_tgt_queue *queue); 258 static int nvmet_fc_tgt_q_get(struct nvmet_fc_tgt_queue *queue); > 259 static void nvmet_fc_tgtport_put(struct nvmet_fc_tgtport *tgtport); 260 static int nvmet_fc_tgtport_get(struct nvmet_fc_tgtport *tgtport); 261 static void nvmet_fc_handle_fcp_rqst(struct nvmet_fc_tgtport *tgtport, 262 struct nvmet_fc_fcp_iod *fod); 263 static void nvmet_fc_delete_target_assoc(struct nvmet_fc_tgt_assoc *assoc); 264 static void nvmet_fc_xmt_ls_rsp(struct nvmet_fc_tgtport *tgtport, 265 struct nvmet_fc_ls_iod *iod); 266 267
Hi Daniel,
kernel test robot noticed the following build warnings:
[auto build test WARNING on linux-nvme/nvme-6.8]
[also build test WARNING on linus/master v6.7-rc6 next-20231219]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Daniel-Wagner/nvmet-fc-remove-unnecessary-bracket/20231219-003117
base: git://git.infradead.org/nvme.git nvme-6.8
patch link: https://lore.kernel.org/r/20231218153105.12717-16-dwagner%40suse.de
patch subject: [PATCH v3 15/16] nvmet-fc: avoid deadlock on delete association path
config: i386-randconfig-013-20231219 (https://download.01.org/0day-ci/archive/20231219/202312191845.lwrs1kbh-lkp@intel.com/config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231219/202312191845.lwrs1kbh-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202312191845.lwrs1kbh-lkp@intel.com/
All warnings (new ones prefixed by >>):
drivers/nvme/target/fc.c: In function 'nvmet_fc_put_tgtport_work':
drivers/nvme/target/fc.c:253:2: error: implicit declaration of function 'nvmet_fc_tgtport_put'; did you mean 'nvmet_ctrl_put'? [-Werror=implicit-function-declaration]
nvmet_fc_tgtport_put(tgtport);
^~~~~~~~~~~~~~~~~~~~
nvmet_ctrl_put
drivers/nvme/target/fc.c: At top level:
>> drivers/nvme/target/fc.c:259:13: warning: conflicting types for 'nvmet_fc_tgtport_put'
static void nvmet_fc_tgtport_put(struct nvmet_fc_tgtport *tgtport);
^~~~~~~~~~~~~~~~~~~~
drivers/nvme/target/fc.c:259:13: error: static declaration of 'nvmet_fc_tgtport_put' follows non-static declaration
drivers/nvme/target/fc.c:253:2: note: previous implicit declaration of 'nvmet_fc_tgtport_put' was here
nvmet_fc_tgtport_put(tgtport);
^~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +/nvmet_fc_tgtport_put +259 drivers/nvme/target/fc.c
c53432030d8642 James Smart 2016-12-02 244
c53432030d8642 James Smart 2016-12-02 245
c53432030d8642 James Smart 2016-12-02 246 static void nvmet_fc_handle_ls_rqst_work(struct work_struct *work);
9d625f7792875e James Smart 2018-02-28 247 static void nvmet_fc_fcp_rqst_op_defer_work(struct work_struct *work);
20d5f3b830ab45 Daniel Wagner 2023-12-18 248 static void nvmet_fc_put_tgtport_work(struct work_struct *work)
20d5f3b830ab45 Daniel Wagner 2023-12-18 249 {
20d5f3b830ab45 Daniel Wagner 2023-12-18 250 struct nvmet_fc_tgtport *tgtport =
20d5f3b830ab45 Daniel Wagner 2023-12-18 251 container_of(work, struct nvmet_fc_tgtport, put_work);
20d5f3b830ab45 Daniel Wagner 2023-12-18 252
20d5f3b830ab45 Daniel Wagner 2023-12-18 253 nvmet_fc_tgtport_put(tgtport);
20d5f3b830ab45 Daniel Wagner 2023-12-18 254 }
c53432030d8642 James Smart 2016-12-02 255 static void nvmet_fc_tgt_a_put(struct nvmet_fc_tgt_assoc *assoc);
c53432030d8642 James Smart 2016-12-02 256 static int nvmet_fc_tgt_a_get(struct nvmet_fc_tgt_assoc *assoc);
c53432030d8642 James Smart 2016-12-02 257 static void nvmet_fc_tgt_q_put(struct nvmet_fc_tgt_queue *queue);
c53432030d8642 James Smart 2016-12-02 258 static int nvmet_fc_tgt_q_get(struct nvmet_fc_tgt_queue *queue);
c53432030d8642 James Smart 2016-12-02 @259 static void nvmet_fc_tgtport_put(struct nvmet_fc_tgtport *tgtport);
c53432030d8642 James Smart 2016-12-02 260 static int nvmet_fc_tgtport_get(struct nvmet_fc_tgtport *tgtport);
0fb228d30b8d72 James Smart 2017-08-01 261 static void nvmet_fc_handle_fcp_rqst(struct nvmet_fc_tgtport *tgtport,
0fb228d30b8d72 James Smart 2017-08-01 262 struct nvmet_fc_fcp_iod *fod);
a96d4bd867129e James Smart 2017-10-27 263 static void nvmet_fc_delete_target_assoc(struct nvmet_fc_tgt_assoc *assoc);
47bf3241064498 James Smart 2020-03-31 264 static void nvmet_fc_xmt_ls_rsp(struct nvmet_fc_tgtport *tgtport,
47bf3241064498 James Smart 2020-03-31 265 struct nvmet_fc_ls_iod *iod);
c53432030d8642 James Smart 2016-12-02 266
c53432030d8642 James Smart 2016-12-02 267
On 12/18/23 16:31, Daniel Wagner wrote: > When deleting an association the shutdown path is deadlocking because we > try to flush the nvmet_wq nested. Avoid this by deadlock by deferring > the put work into its own work item. > Maybe deleting the first 'by' ? > Signed-off-by: Daniel Wagner <dwagner@suse.de> > --- > drivers/nvme/target/fc.c | 14 ++++++++++++-- > 1 file changed, 12 insertions(+), 2 deletions(-) > > diff --git a/drivers/nvme/target/fc.c b/drivers/nvme/target/fc.c > index 23d8779dc221..30ba4ede333f 100644 > --- a/drivers/nvme/target/fc.c > +++ b/drivers/nvme/target/fc.c > @@ -111,6 +111,8 @@ struct nvmet_fc_tgtport { > struct nvmet_fc_port_entry *pe; > struct kref ref; > u32 max_sg_cnt; > + > + struct work_struct put_work; > }; > > struct nvmet_fc_port_entry { > @@ -243,6 +245,13 @@ static LIST_HEAD(nvmet_fc_portentry_list); > > static void nvmet_fc_handle_ls_rqst_work(struct work_struct *work); > static void nvmet_fc_fcp_rqst_op_defer_work(struct work_struct *work); > +static void nvmet_fc_put_tgtport_work(struct work_struct *work) > +{ > + struct nvmet_fc_tgtport *tgtport = > + container_of(work, struct nvmet_fc_tgtport, put_work); > + > + nvmet_fc_tgtport_put(tgtport); > +} > static void nvmet_fc_tgt_a_put(struct nvmet_fc_tgt_assoc *assoc); > static int nvmet_fc_tgt_a_get(struct nvmet_fc_tgt_assoc *assoc); > static void nvmet_fc_tgt_q_put(struct nvmet_fc_tgt_queue *queue); > @@ -359,7 +368,7 @@ __nvmet_fc_finish_ls_req(struct nvmet_fc_ls_req_op *lsop) > > if (!lsop->req_queued) { > spin_unlock_irqrestore(&tgtport->lock, flags); > - nvmet_fc_tgtport_put(tgtport); > + queue_work(nvmet_wq, &tgtport->put_work); > return; > } > > @@ -373,7 +382,7 @@ __nvmet_fc_finish_ls_req(struct nvmet_fc_ls_req_op *lsop) > (lsreq->rqstlen + lsreq->rsplen), > DMA_BIDIRECTIONAL); > > - nvmet_fc_tgtport_put(tgtport); > + queue_work(nvmet_wq, &tgtport->put_work); > } > > static int > @@ -1402,6 +1411,7 @@ nvmet_fc_register_targetport(struct nvmet_fc_port_info *pinfo, > kref_init(&newrec->ref); > ida_init(&newrec->assoc_cnt); > newrec->max_sg_cnt = template->max_sgl_segments; > + INIT_WORK(&newrec->put_work, nvmet_fc_put_tgtport_work); > > ret = nvmet_fc_alloc_ls_iodlist(newrec); > if (ret) { Otherwise: Reviewed-by: Hannes Reinecke <hare@suse.de> Cheers, Hannes
diff --git a/drivers/nvme/target/fc.c b/drivers/nvme/target/fc.c index 23d8779dc221..30ba4ede333f 100644 --- a/drivers/nvme/target/fc.c +++ b/drivers/nvme/target/fc.c @@ -111,6 +111,8 @@ struct nvmet_fc_tgtport { struct nvmet_fc_port_entry *pe; struct kref ref; u32 max_sg_cnt; + + struct work_struct put_work; }; struct nvmet_fc_port_entry { @@ -243,6 +245,13 @@ static LIST_HEAD(nvmet_fc_portentry_list); static void nvmet_fc_handle_ls_rqst_work(struct work_struct *work); static void nvmet_fc_fcp_rqst_op_defer_work(struct work_struct *work); +static void nvmet_fc_put_tgtport_work(struct work_struct *work) +{ + struct nvmet_fc_tgtport *tgtport = + container_of(work, struct nvmet_fc_tgtport, put_work); + + nvmet_fc_tgtport_put(tgtport); +} static void nvmet_fc_tgt_a_put(struct nvmet_fc_tgt_assoc *assoc); static int nvmet_fc_tgt_a_get(struct nvmet_fc_tgt_assoc *assoc); static void nvmet_fc_tgt_q_put(struct nvmet_fc_tgt_queue *queue); @@ -359,7 +368,7 @@ __nvmet_fc_finish_ls_req(struct nvmet_fc_ls_req_op *lsop) if (!lsop->req_queued) { spin_unlock_irqrestore(&tgtport->lock, flags); - nvmet_fc_tgtport_put(tgtport); + queue_work(nvmet_wq, &tgtport->put_work); return; } @@ -373,7 +382,7 @@ __nvmet_fc_finish_ls_req(struct nvmet_fc_ls_req_op *lsop) (lsreq->rqstlen + lsreq->rsplen), DMA_BIDIRECTIONAL); - nvmet_fc_tgtport_put(tgtport); + queue_work(nvmet_wq, &tgtport->put_work); } static int @@ -1402,6 +1411,7 @@ nvmet_fc_register_targetport(struct nvmet_fc_port_info *pinfo, kref_init(&newrec->ref); ida_init(&newrec->assoc_cnt); newrec->max_sg_cnt = template->max_sgl_segments; + INIT_WORK(&newrec->put_work, nvmet_fc_put_tgtport_work); ret = nvmet_fc_alloc_ls_iodlist(newrec); if (ret) {