From mboxrd@z Thu Jan 1 00:00:00 1970 From: Greg-KH Date: Thu, 16 Nov 2017 16:46:42 +0000 Subject: Re: [PATCH-3.18.y 2/2] iscsi-target: Fix iscsi_np reset hung task during parallel delete Message-Id: <20171116164642.GI24442@kroah.com> List-Id: References: <1510813060-15334-1-git-send-email-nab@linux-iscsi.org> <1510813060-15334-3-git-send-email-nab@linux-iscsi.org> In-Reply-To: <1510813060-15334-3-git-send-email-nab@linux-iscsi.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: "Nicholas A. Bellinger" Cc: target-devel , stable , Mike Christie , Hannes Reinecke On Thu, Nov 16, 2017 at 06:17:40AM +0000, Nicholas A. Bellinger wrote: > From: Nicholas Bellinger > > This patch fixes a bug associated with iscsit_reset_np_thread() > that can occur during parallel configfs rmdir of a single iscsi_np > used across multiple iscsi-target instances, that would result in > hung task(s) similar to below where configfs rmdir process context > was blocked indefinately waiting for iscsi_np->np_restart_comp > to finish: > > [ 6726.112076] INFO: task dcp_proxy_node_:15550 blocked for more than 120 seconds. > [ 6726.119440] Tainted: G W O 4.1.26-3321 #2 > [ 6726.125045] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. > [ 6726.132927] dcp_proxy_node_ D ffff8803f202bc88 0 15550 1 0x00000000 > [ 6726.140058] ffff8803f202bc88 ffff88085c64d960 ffff88083b3b1ad0 ffff88087fffeb08 > [ 6726.147593] ffff8803f202c000 7fffffffffffffff ffff88083f459c28 ffff88083b3b1ad0 > [ 6726.155132] ffff88035373c100 ffff8803f202bca8 ffffffff8168ced2 ffff8803f202bcb8 > [ 6726.162667] Call Trace: > [ 6726.165150] [] schedule+0x32/0x80 > [ 6726.170156] [] schedule_timeout+0x214/0x290 > [ 6726.176030] [] ? __send_signal+0x52/0x4a0 > [ 6726.181728] [] wait_for_completion+0x96/0x100 > [ 6726.187774] [] ? wake_up_state+0x10/0x10 > [ 6726.193395] [] iscsit_reset_np_thread+0x62/0xe0 [iscsi_target_mod] > [ 6726.201278] [] iscsit_tpg_disable_portal_group+0x96/0x190 [iscsi_target_mod] > [ 6726.210033] [] lio_target_tpg_store_enable+0x4f/0xc0 [iscsi_target_mod] > [ 6726.218351] [] configfs_write_file+0xaa/0x110 > [ 6726.224392] [] vfs_write+0xa4/0x1b0 > [ 6726.229576] [] SyS_write+0x41/0xb0 > [ 6726.234659] [] system_call_fastpath+0x12/0x71 > > It would happen because each iscsit_reset_np_thread() sets state > to ISCSI_NP_THREAD_RESET, sends SIGINT, and then blocks waiting > for completion on iscsi_np->np_restart_comp. > > However, if iscsi_np was active processing a login request and > more than a single iscsit_reset_np_thread() caller to the same > iscsi_np was blocked on iscsi_np->np_restart_comp, iscsi_np > kthread process context in __iscsi_target_login_thread() would > flush pending signals and only perform a single completion of > np->np_restart_comp before going back to sleep within transport > specific iscsit_transport->iscsi_accept_np code. > > To address this bug, add a iscsi_np->np_reset_count and update > __iscsi_target_login_thread() to keep completing np->np_restart_comp > until ->np_reset_count has reached zero. > > Reported-by: Gary Guo > Tested-by: Gary Guo > Cc: Mike Christie > Cc: Hannes Reinecke > Cc: stable@vger.kernel.org # 3.10+ > Signed-off-by: Nicholas Bellinger > --- > drivers/target/iscsi/iscsi_target.c | 1 + > drivers/target/iscsi/iscsi_target_core.h | 1 + > drivers/target/iscsi/iscsi_target_login.c | 7 +++++-- > include/target/iscsi/iscsi_target_core.h | 1 + > 4 files changed, 8 insertions(+), 2 deletions(-) What is the git commit id of this patch in Linus's tree? thanks, greg k-h From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:52988 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759797AbdKPQqk (ORCPT ); Thu, 16 Nov 2017 11:46:40 -0500 Date: Thu, 16 Nov 2017 17:46:42 +0100 From: Greg-KH To: "Nicholas A. Bellinger" Cc: target-devel , stable , Mike Christie , Hannes Reinecke Subject: Re: [PATCH-3.18.y 2/2] iscsi-target: Fix iscsi_np reset hung task during parallel delete Message-ID: <20171116164642.GI24442@kroah.com> References: <1510813060-15334-1-git-send-email-nab@linux-iscsi.org> <1510813060-15334-3-git-send-email-nab@linux-iscsi.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1510813060-15334-3-git-send-email-nab@linux-iscsi.org> Sender: stable-owner@vger.kernel.org List-ID: On Thu, Nov 16, 2017 at 06:17:40AM +0000, Nicholas A. Bellinger wrote: > From: Nicholas Bellinger > > This patch fixes a bug associated with iscsit_reset_np_thread() > that can occur during parallel configfs rmdir of a single iscsi_np > used across multiple iscsi-target instances, that would result in > hung task(s) similar to below where configfs rmdir process context > was blocked indefinately waiting for iscsi_np->np_restart_comp > to finish: > > [ 6726.112076] INFO: task dcp_proxy_node_:15550 blocked for more than 120 seconds. > [ 6726.119440] Tainted: G W O 4.1.26-3321 #2 > [ 6726.125045] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. > [ 6726.132927] dcp_proxy_node_ D ffff8803f202bc88 0 15550 1 0x00000000 > [ 6726.140058] ffff8803f202bc88 ffff88085c64d960 ffff88083b3b1ad0 ffff88087fffeb08 > [ 6726.147593] ffff8803f202c000 7fffffffffffffff ffff88083f459c28 ffff88083b3b1ad0 > [ 6726.155132] ffff88035373c100 ffff8803f202bca8 ffffffff8168ced2 ffff8803f202bcb8 > [ 6726.162667] Call Trace: > [ 6726.165150] [] schedule+0x32/0x80 > [ 6726.170156] [] schedule_timeout+0x214/0x290 > [ 6726.176030] [] ? __send_signal+0x52/0x4a0 > [ 6726.181728] [] wait_for_completion+0x96/0x100 > [ 6726.187774] [] ? wake_up_state+0x10/0x10 > [ 6726.193395] [] iscsit_reset_np_thread+0x62/0xe0 [iscsi_target_mod] > [ 6726.201278] [] iscsit_tpg_disable_portal_group+0x96/0x190 [iscsi_target_mod] > [ 6726.210033] [] lio_target_tpg_store_enable+0x4f/0xc0 [iscsi_target_mod] > [ 6726.218351] [] configfs_write_file+0xaa/0x110 > [ 6726.224392] [] vfs_write+0xa4/0x1b0 > [ 6726.229576] [] SyS_write+0x41/0xb0 > [ 6726.234659] [] system_call_fastpath+0x12/0x71 > > It would happen because each iscsit_reset_np_thread() sets state > to ISCSI_NP_THREAD_RESET, sends SIGINT, and then blocks waiting > for completion on iscsi_np->np_restart_comp. > > However, if iscsi_np was active processing a login request and > more than a single iscsit_reset_np_thread() caller to the same > iscsi_np was blocked on iscsi_np->np_restart_comp, iscsi_np > kthread process context in __iscsi_target_login_thread() would > flush pending signals and only perform a single completion of > np->np_restart_comp before going back to sleep within transport > specific iscsit_transport->iscsi_accept_np code. > > To address this bug, add a iscsi_np->np_reset_count and update > __iscsi_target_login_thread() to keep completing np->np_restart_comp > until ->np_reset_count has reached zero. > > Reported-by: Gary Guo > Tested-by: Gary Guo > Cc: Mike Christie > Cc: Hannes Reinecke > Cc: stable@vger.kernel.org # 3.10+ > Signed-off-by: Nicholas Bellinger > --- > drivers/target/iscsi/iscsi_target.c | 1 + > drivers/target/iscsi/iscsi_target_core.h | 1 + > drivers/target/iscsi/iscsi_target_login.c | 7 +++++-- > include/target/iscsi/iscsi_target_core.h | 1 + > 4 files changed, 8 insertions(+), 2 deletions(-) What is the git commit id of this patch in Linus's tree? thanks, greg k-h