Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp392593imm; Tue, 9 Oct 2018 20:35:28 -0700 (PDT) X-Google-Smtp-Source: ACcGV61XEUD9gZ4p7yyQ6p/Nw7W73DxTj+vAYwLvQF9jp1YVUyJRRh5DopeSeqfU1ZMvpne9hnTN X-Received: by 2002:a17:902:d808:: with SMTP id a8-v6mr32159166plz.306.1539142528576; Tue, 09 Oct 2018 20:35:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539142528; cv=none; d=google.com; s=arc-20160816; b=v3L6OIwVfGwJQ3dNd71m8qX3ze7ixQPMGjvgD2b4TyvPnmWF0tq+yYVHchJg8FLJ/2 zSCeiEKphwpNCby6POHSzTrdEj219t7tYnpS/j0aY2nOY8HfSyWpqYSJf6uCJ6H7QPgK 1/toTsa6SGBvNP29vj11J7aRKss5XfMltBfisS1q/GogeqzVbLD1GO3SmhlWhgCRlx05 oSeD5/0k/jpyrtoGXuFBU2T2ohMpAa9d7BhnPjicMoo2Q5rz8ZbMmqvWEtjO02C7IyH1 EyxikO50UWm+EecfviRPb6H+Khf3Mn3Cgl562x2M1heNCfyDTkVz0jYq3P6R37DQxgA0 suDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=0sOXnNJovOStj8YiQUEyfIJK5puT94i0VYdwmMQpZuM=; b=q94+18e21vU7LUHD3feJVoZbbBGjQZEOvuW62uHRwTwt0iVhyholPJXdfAFdcM+II/ mjmHXs/SciAuIV1tWPn+SZibU2AouTQr7PoFRL2ZxP+yIFh9HyEFUeFBZXG4JulARvgi QlPCPE7/vvin/okOlFhUPUKXZLSrGAHbnZc4shjByxcLhuhDXLvIPl3mkJzxGxf37xAv 85aXbBuqwNZ43mq6LzHNWQTQt89e7c83/sy/k2LnFasrJWGBTdl8yyu0VQPo2QbGY5Dw HlPmTHv4Wv2pUx/4tGsAR5UunCo/eh2W+UE66oBsWye3bWLxl1zGRmQsTBjQzmh1zZBo xTYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linux-iscsi.org header.s=default.private header.b=X86T1VvC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d4-v6si22828777pla.299.2018.10.09.20.35.13; Tue, 09 Oct 2018 20:35:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@linux-iscsi.org header.s=default.private header.b=X86T1VvC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727005AbeJJKvS (ORCPT + 99 others); Wed, 10 Oct 2018 06:51:18 -0400 Received: from mail.linux-iscsi.org ([67.23.28.174]:53479 "EHLO linux-iscsi.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726871AbeJJKvS (ORCPT ); Wed, 10 Oct 2018 06:51:18 -0400 Received: from linux-iscsi.org (localhost [127.0.0.1]) by linux-iscsi.org (Postfix) with ESMTP id DDC1540ABD; Wed, 10 Oct 2018 03:23:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=linux-iscsi.org; s=default.private; t=1539141795; bh=gTfSdxWSg/YkfEjdAi/RGhIDcrnaz5r Ql5P8awK1xXk=; h=From:To:Cc:Subject:Date:Message-Id; b=X86T1VvCxoMC XVaoeadBwIllh6NFUnXvSnPFAt+ljCQOZm+NQ0lmmNm4TiJwn9g15O+XCyqy/tnWn/E y0kx19O3ZuVeMQp5jAuEzF+Ww2Ja5Xiv6rCtMXn+B2eI6jxUc1xwyABQo7fuUYoNy9C xlGIshNeBuuEmom7kzn4by8eU= From: "Nicholas A. Bellinger" 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 Subject: [PATCH 0/2] target: Fix v4.19-rc active I/O shutdown deadlock Date: Wed, 10 Oct 2018 03:23:08 +0000 Message-Id: <1539141790-13557-1-git-send-email-nab@linux-iscsi.org> X-Mailer: git-send-email 1.7.2.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nicholas Bellinger 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 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