From patchwork Fri Jul 21 14:48:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 9857091 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 73E7E601C0 for ; Fri, 21 Jul 2017 14:51:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5E9F4287EB for ; Fri, 21 Jul 2017 14:51:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5336C287EF; Fri, 21 Jul 2017 14:51: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 8DF4E287EB for ; Fri, 21 Jul 2017 14:51:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753870AbdGUOtY (ORCPT ); Fri, 21 Jul 2017 10:49:24 -0400 Received: from mail-qt0-f195.google.com ([209.85.216.195]:34352 "EHLO mail-qt0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753785AbdGUOsS (ORCPT ); Fri, 21 Jul 2017 10:48:18 -0400 Received: by mail-qt0-f195.google.com with SMTP id o3so2745952qto.1 for ; Fri, 21 Jul 2017 07:48:17 -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=2lYkijMk1unN0ElVks2ExdC7ySQB4AU/it04x/V7m+o=; b=1QqDmDBo2+t+lA0NEafHn4xE5SErqI2G9K3mnKCUcESPX/MfkbfwR2q6Mo7qCLELHi mgVpS5npYzexM+iXB9eD7mWp1PYjUJ7ZUOwPMykTFDbNXion/8C9vbqp4LSFLiMhBMw0 QrxfbHKzWrMkZxZt5ovI83BXH4mth7E/9Oipyt2Aq5fvfPOXgU4My29zoCrVYu+nwtg9 kGUH9ND4KWOcRtoJI8bO65cVMX8/A+ZWtGJbFesW6vGqxZwCU5D+ASYqyPCq+P6buIq9 bRMvTp9Ym7PnTv1oiib17lLMIu7G0ydwBybBN9qyjHMZl/l+l1ZaycmtXIU0Ke5nuSjz 5EAQ== 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=2lYkijMk1unN0ElVks2ExdC7ySQB4AU/it04x/V7m+o=; b=RR6OyDBkEsfYlZ+C4UfT5HygNNDwh6xV9a99n9OYNWWzhy54kmZrVzj8JIO0FBan0g qqBG9Q2M+bSFsidTB5AsYf7n0qW565WIhj1UbYswKWrFQxgeuDmqHFBt8hMLK6BvRLfO kXVZt69iM+HnkOIofMF99Sg3bwbNQT6jvAveccrUJsw9jhpBT7FQx+mxe9mHC0aQXCO9 dNMpi/q4m01QIt17v97TkAFHDyvrLMAfIa7fMZiEmnHx6MYUmoOG71HXpoWF84+l6NCA xZ6r5/b9zhiaxhL65D24KHEwz8NL3AgAjmSk2nvE7pksf5873urQiT5hXcIl17U2LdEz 88ow== X-Gm-Message-State: AIVw112/3EvCvf+3KdqDS4GIKblN0/AZiuw5xgfGftAs8E1F+xsnSAdZ cCxXLsbLzNPVJjRmxCkMNQ== X-Received: by 10.237.49.194 with SMTP id 60mr9470235qth.73.1500648497359; Fri, 21 Jul 2017 07:48:17 -0700 (PDT) Received: from localhost ([2606:a000:4381:1201:225:22ff:feb3:e51a]) by smtp.gmail.com with ESMTPSA id i18sm4068474qkh.18.2017.07.21.07.48.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 21 Jul 2017 07:48:16 -0700 (PDT) From: josef@toxicpanda.com X-Google-Original-From: jbacik@fb.com To: axboe@kernel.dk, nbd-general@lists.sourceforge.net, linux-block@vger.kernel.org, kernel-team@fb.com Cc: Josef Bacik Subject: [PATCH 1/3] nbd: allow multiple disconnects to be sent Date: Fri, 21 Jul 2017 10:48:13 -0400 Message-Id: <1500648495-13337-1-git-send-email-jbacik@fb.com> X-Mailer: git-send-email 2.7.4 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 There's no reason to limit ourselves to one disconnect message per socket. Sometimes networks do strange things, might as well let sysadmins hit the panic button as much as they want. Signed-off-by: Josef Bacik --- drivers/block/nbd.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index 87a0a29..f91e7ac 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -991,9 +991,8 @@ static int nbd_disconnect(struct nbd_device *nbd) struct nbd_config *config = nbd->config; dev_info(disk_to_dev(nbd->disk), "NBD_DISCONNECT\n"); - if (!test_and_set_bit(NBD_DISCONNECT_REQUESTED, - &config->runtime_flags)) - send_disconnects(nbd); + set_bit(NBD_DISCONNECT_REQUESTED, &config->runtime_flags); + send_disconnects(nbd); return 0; }