linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] target: Fix v4.19-rc active I/O shutdown deadlock
@ 2018-10-10  3:23 Nicholas A. Bellinger
  2018-10-10  3:23 ` [PATCH 1/2] sched/wait: Add wait_event_lock_irq_timeout for TASK_UNINTERRUPTIBLE usage Nicholas A. Bellinger
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Nicholas A. Bellinger @ 2018-10-10  3:23 UTC (permalink / raw)
  To: target-devel
  Cc: linux-scsi, lkml, Martin K. Petersen, Mike Christie,
	Hannes Reinecke, Christoph Hellwig, Sagi Grimberg, Bryant G. Ly,
	Peter Zijlstra (Intel),
	Nicholas Bellinger

From: Nicholas Bellinger <nab@linux-iscsi.org>

Hi MNC, MKP & Co,

While testing v4.19-rc recently with simple backend I/O error injection
(via delayed BIO completion), I was able to trigger an end-less loop
deadlock with recent changes in commit 00d909a107:

  Author: Bart Van Assche <bart.vanassche@wdc.com>
  Date:   Fri Jun 22 14:52:53 2018 -0700

      scsi: target: Make the session shutdown code also wait for commands that are being aborted

It comes down to an incorrect assumption wrt signals during session
shutdown plus active I/O quiesce, which triggers an endless loop
immediately during session shutdown as se_session->sess_list_wq
waits for outstanding backend I/O to complete.

The easiest reproduction is with iser-target or simulation with plain
old iscsi-target/TCP ports.  However, any fabric driver who triggers
session shutdown from user-space processes with signals pending can
easily trigger it and bring down the machine.

The fix is simple, but requires a new wait_event_lock_irq_timeout()
macro to allow TASK_UNINTERRUPTIBLE to be set in order to work as
expected for all fabric driver session shutdown cases.

So short of reverting commit 00d909a107 now for v4.19, this is going
to be the best option.

Please review for v4.19, or v4.20-rc1 with stable CC's for both.

Thank you.

Nicholas Bellinger (2):
  sched/wait: Add wait_event_lock_irq_timeout for TASK_UNINTERRUPTIBLE
    usage
  target: Fix target_wait_for_sess_cmds breakage with active signals

 drivers/target/target_core_transport.c |  4 ++--
 include/linux/wait.h                   | 20 +++++++++++++++-----
 2 files changed, 17 insertions(+), 7 deletions(-)

-- 
1.9.1


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2018-10-16 14:38 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-10  3:23 [PATCH 0/2] target: Fix v4.19-rc active I/O shutdown deadlock Nicholas A. Bellinger
2018-10-10  3:23 ` [PATCH 1/2] sched/wait: Add wait_event_lock_irq_timeout for TASK_UNINTERRUPTIBLE usage Nicholas A. Bellinger
2018-10-10  3:59   ` Ly, Bryant
2018-10-10  8:31   ` Peter Zijlstra
2018-10-12  2:18   ` Bart Van Assche
2018-10-10  3:23 ` [PATCH 2/2] target: Fix target_wait_for_sess_cmds breakage with active signals Nicholas A. Bellinger
2018-10-10  4:01   ` Ly, Bryant
2018-10-10  4:58   ` Bart Van Assche
2018-10-10  8:43   ` Peter Zijlstra
2018-10-11  5:40     ` Nicholas A. Bellinger
2018-10-11  7:55       ` Peter Zijlstra
2018-10-10 16:58   ` Mike Christie
2018-10-11  5:56     ` Nicholas A. Bellinger
2018-10-11 13:05       ` Ly, Bryant
2018-10-16  4:13         ` Martin K. Petersen
2018-10-16 14:37           ` Ly, Bryant
2018-10-10  4:20 ` [PATCH 0/2] target: Fix v4.19-rc active I/O shutdown deadlock Nicholas A. Bellinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).