From patchwork Thu Oct 19 20:21:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 10018283 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 9891460215 for ; Thu, 19 Oct 2017 20:22:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8D1FA284F1 for ; Thu, 19 Oct 2017 20:22:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 81BF728E52; Thu, 19 Oct 2017 20:22:07 +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.4 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 00FC2284F1 for ; Thu, 19 Oct 2017 20:22:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754003AbdJSUWE (ORCPT ); Thu, 19 Oct 2017 16:22:04 -0400 Received: from mail-qk0-f193.google.com ([209.85.220.193]:48325 "EHLO mail-qk0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753580AbdJSUWB (ORCPT ); Thu, 19 Oct 2017 16:22:01 -0400 Received: by mail-qk0-f193.google.com with SMTP id d67so11940895qkg.5 for ; Thu, 19 Oct 2017 13:22:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=O+Uv445bxUUcUovX7HxJ2ogTm9zbNZE/OeIKvt3YtXI=; b=KrmBofBp9oQqSjpbPpuwUrFd7wv6EREPbEuCDsWWGMXKSiq0jPXB2T9CZ9E9TxJjyV 4kWukJ4QYx6eMbMIAjmgjCpMWpVUKTYHzQMjy/ge8okuPKdO7K7W0k4epfdSkKnl6OeD kJyJ2AR0FKIumMGktdRYXDOBJJSBU94chp0jVTerq6k9udlfyjB7EEm/wzcelQJC3pyw BH0BkL2MlIXUmzRM3ug9J+n2w/saX/Tl4kRcm6Waa3R4NfuDlrmoPTPUmSOssua/DfGH ajIj12+eSqSxi352O8SBJBpWQ5Wz3z1UO2zgsVShVoViGP3b8yK4gDoBH/44JI9eL4Xa 0WXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=O+Uv445bxUUcUovX7HxJ2ogTm9zbNZE/OeIKvt3YtXI=; b=QNRU8r7yLgIzFoZP9LGDOEG55ua4+exWfekA8CjFkD3OakCB4ZZvkUsAzOptVB49aT CqP8GwoH61kwpFAseKKfapctIclGm99q1TFeINUN7bUFnyBJvrSaTDoFVBo7Fo3Ywl4C 6ObIpNsx2rZCtiYmgNslYw4OA50OKN/bFYBMQ/Xvpg8n28W+QVSHl8T1AwSasXWe0Kks FWynV8Tw79aidL+xPSm6wmvETo5dJ25FIHC/Et0vuDGAxHWz/kvbaYw/HHe+cVucxZdO hTnaIlZLdHn5+vkrpjspgH5rVnmGZ9jrn08tpH8w1VlDfjdG3f3ugg9hN5KKMKbxTF/Q z6EA== X-Gm-Message-State: AMCzsaVooFTTdnwXUzfpqaVHAlPT5CoPwJrqOCENlRKhaHVtK0GmOxTD F9z9w28/G8DS2As6r7vHUrnBCg== X-Google-Smtp-Source: ABhQp+R85ehaNWXApfdAYCTuu1qRGhkZmZmWTnUuIdXixouTk0xzW72jjG0Ai1X8vXW1cUrLxmvrvw== X-Received: by 10.55.103.15 with SMTP id b15mr3834005qkc.224.1508444521026; Thu, 19 Oct 2017 13:22:01 -0700 (PDT) Received: from localhost ([2606:a000:4381:1201:225:22ff:feb3:e51a]) by smtp.gmail.com with ESMTPSA id v189sm9586744qkb.46.2017.10.19.13.22.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Oct 2017 13:22:00 -0700 (PDT) From: Josef Bacik To: axboe@kernel.dk, nbd@other.debian.org, linux-block@vger.kernel.org, kernel-team@fb.com Cc: Josef Bacik , stable@vger.kernel.org Subject: [PATCH 1/2] nbd: wait uninterruptible for the dead timeout Date: Thu, 19 Oct 2017 16:21:58 -0400 Message-Id: <1508444519-8751-1-git-send-email-josef@toxicpanda.com> X-Mailer: git-send-email 2.7.5 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Josef Bacik If we have a pending signal or the user kills their application then it'll bring down the whole device, which is less than awesome. Instead wait uninterruptible for the dead timeout so we're sure we gave it our best shot. Fixes: 560bc4b39952 ("nbd: handle dead connections") Cc: stable@vger.kernel.org Signed-off-by: Josef Bacik --- drivers/block/nbd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index 883dfebd3014..fd2f724462b6 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -715,9 +715,9 @@ static int wait_for_reconnect(struct nbd_device *nbd) return 0; if (test_bit(NBD_DISCONNECTED, &config->runtime_flags)) return 0; - wait_event_interruptible_timeout(config->conn_wait, - atomic_read(&config->live_connections), - config->dead_conn_timeout); + wait_event_timeout(config->conn_wait, + atomic_read(&config->live_connections), + config->dead_conn_timeout); return atomic_read(&config->live_connections); }