From patchwork Mon Nov 6 21:11:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 10044515 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 E24F0604D3 for ; Mon, 6 Nov 2017 21:12:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D3E4229F26 for ; Mon, 6 Nov 2017 21:12:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C89ED2A023; Mon, 6 Nov 2017 21:12:04 +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 0C2BB2A022 for ; Mon, 6 Nov 2017 21:12:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753392AbdKFVMB (ORCPT ); Mon, 6 Nov 2017 16:12:01 -0500 Received: from mail-qk0-f193.google.com ([209.85.220.193]:46055 "EHLO mail-qk0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752496AbdKFVMA (ORCPT ); Mon, 6 Nov 2017 16:12:00 -0500 Received: by mail-qk0-f193.google.com with SMTP id f199so12751315qke.2 for ; Mon, 06 Nov 2017 13:12:00 -0800 (PST) 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=i8DHrbX4zlbNejZRoe4C/hqrOPJfFVSPoLcow9Pyj2Q=; b=eLqjux7KeZChX9IA9xB3xCQPNOb0tHn4Kcb+ME5HshENHXwp5JaECyq34+FbTc7ndc sEmX6QBkduP7w+VdLgwB6feTzxxMlfdjNbJxmprpadQHvfSm3mn0aaoSo3ibRFTWKbKd 10RZbpw1eQY/HuoHereuyDcO4VG61yQsvEqA9ae3XyhBd54aTEjJz6rnM1K2hLnoaibe 61mchc6JbKakteLJY/l0nzYe4SSm9HXOkNmFr4D+GTUn5wq957Qjc/1WXCFM12UWf96f uxFSUXkFWum+PdCKsJme/9LMOdOgSRDs5b48UsXOegskpLeIMVI6XeNwCOV26nE+A5Ce v3ZQ== 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=i8DHrbX4zlbNejZRoe4C/hqrOPJfFVSPoLcow9Pyj2Q=; b=IiAUFiBdNuAxKVgBU8X/5dphcOZnl+6N2sbKAC8q5uWZ/nwR0A1+mmNlMaY6DYeVJm qymSguIkgpFsRcbwVh7G386J1q6VmP+MGgYCPEfiiUEDzHQmZZ8Ggqnbkm+m/x9VflWI giOABCWioePGAF98hk2s6AHmg4bVp2xPP3aGOI+eJV1dEIpkG+3h4l1DZJKMvGaJQ01y tb1Ux/jjXT/rbZ4grtWQbyFb7Ce+xExTe5baDHdS9hbhi594CooljjYjM8RL3rD9MrN2 PzvO6FRFzhPaA1M5al0LFD7Ik++gpvippREH7zF8yKPK1Hr/Nga7frEVsHDzsvpt3PPd 7cUg== X-Gm-Message-State: AJaThX45KLN+F++JwoTDAg+dEEcLdwHzaSONHG/mlJtcfrrmXcwdejf1 vTOK0f3uOkqkyQ1C5fIS/uPP3w== X-Google-Smtp-Source: ABhQp+QwSYzSdxEqNnUBRSe2/m+E+0VsPbI7SxHjWMfAu7EbkkAFtjmqEKFd81QFkNKBw6dLFL4QZw== X-Received: by 10.55.5.149 with SMTP id 143mr4661997qkf.298.1510002719651; Mon, 06 Nov 2017 13:11:59 -0800 (PST) Received: from localhost (cpe-2606-A000-4381-1201-225-22FF-FEB3-E51A.dyn6.twc.com. [2606:a000:4381:1201:225:22ff:feb3:e51a]) by smtp.gmail.com with ESMTPSA id b131sm8699999qkg.18.2017.11.06.13.11.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Nov 2017 13:11:59 -0800 (PST) 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][RESEND] nbd: wait uninterruptible for the dead timeout Date: Mon, 6 Nov 2017 16:11:57 -0500 Message-Id: <1510002718-9574-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 9adfb5445f8d..fdef8efcdabc 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -723,9 +723,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); }