From patchwork Wed May 16 18:36:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 10404651 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 9141E602C2 for ; Wed, 16 May 2018 18:36:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 81B3F2866C for ; Wed, 16 May 2018 18:36:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7659228674; Wed, 16 May 2018 18:36:12 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 2814C28671 for ; Wed, 16 May 2018 18:36:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750835AbeEPSgL (ORCPT ); Wed, 16 May 2018 14:36:11 -0400 Received: from mail-qt0-f193.google.com ([209.85.216.193]:36343 "EHLO mail-qt0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750759AbeEPSgK (ORCPT ); Wed, 16 May 2018 14:36:10 -0400 Received: by mail-qt0-f193.google.com with SMTP id q6-v6so2410345qtn.3 for ; Wed, 16 May 2018 11:36:10 -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:in-reply-to:references; bh=RenfJXTtopjP3vtUynJh20oeLF3BYEqus1+KcYG/1D8=; b=aEVLgD7tiZK9KIXwKFDT8NsVRQKh4R/RZzKxwT3rtRB72mFhBBgmgJWkupJxFVHBqK rtN07DDQe+xjZSJBRJQB+GHlmbQo2NxH8JVpxt7JuGpqZYUNC/KXqKrASuccK5STLIkE B4+mVxW0c3j8M9THTq/bOBcrj7Ar7joTOXGaLS8VEMmh9J1BxbXzCEqJ93ymqacLsTCu g5Ef4gLZegdS1bd+2j12N1pem5zWi1y+BJcG4DdhuU8523zpTbcxw4PibLKuMnYqoLBP sB5Dn6dGFw4JS+rak0KUG7tf7Yj2mqrNaJN7Y3NkEWUoCKwWUCi9lM/GrdSxHEtsTcCk +cgw== 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:in-reply-to :references; bh=RenfJXTtopjP3vtUynJh20oeLF3BYEqus1+KcYG/1D8=; b=Mlx5XkquRPMh4bjxx98rzljTy9Hn2A8IhT4Q5xyKe9YlWOwmu4Ay0ymKKv382D802H dqJZQqa7gNfNiPA+jLzCrl4NgPtN9369gh6gR26AepVu/cIoJ+uzUH1bB7UYvc6Q4E/D NyFhVzaNxiz9W+DNO1DPQjwvtC9fJOp65OWO9HQrKoeQOoQiCpDaqvHvyah8VLiIufQv wLBpK6su3NTPIajn14oZzPmeoMNdd/Zu53UUb6IaTCnl+N/5pYRTotWxCuZQz/PCZEPq p5lCjTOTQwg08qKdP73P2+vRBAOdOONEcRv7f+ZW8IjkIXJt0J21zboS2LZxfuCNGECL FooQ== X-Gm-Message-State: ALKqPwfeX2J+gHzGhhTDFz12G7tmZlqu5ufHILjy7oNzbX6T1JLZDzos DZR1HyaG8o3dfPR+Md0ejTtK1K+d X-Google-Smtp-Source: AB8JxZrURLbx7pdwWKXEnQ4qLAtbazj5K0NLaDEqxMreQEsG52brM80HCKkEpd7Hwa/W3tuAaq73zg== X-Received: by 2002:a0c:b03d:: with SMTP id k58-v6mr2173297qvc.121.1526495770116; Wed, 16 May 2018 11:36:10 -0700 (PDT) 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 j130-v6sm1920172qke.67.2018.05.16.11.36.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 16 May 2018 11:36:09 -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 Subject: [PATCH 3/5] nbd: clear_sock on netlink disconnect Date: Wed, 16 May 2018 14:36:03 -0400 Message-Id: <20180516183605.16159-3-josef@toxicpanda.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180516183605.16159-1-josef@toxicpanda.com> References: <20180516183605.16159-1-josef@toxicpanda.com> 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 This is what the ioctl based nbd disconnect does as well. Without this the device will just sit there and wait for the connection to go away (or IO to occur) before the device gets torn down. Instead clear everything up on our end so the configuration goes away as quickly as possible. Signed-off-by: Josef Bacik --- drivers/block/nbd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index 7e83d6364b35..bc47bae9697a 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -1765,6 +1765,7 @@ static int nbd_genl_disconnect(struct sk_buff *skb, struct genl_info *info) } mutex_lock(&nbd->config_lock); nbd_disconnect(nbd); + nbd_clear_sock(nbd); mutex_unlock(&nbd->config_lock); if (test_and_clear_bit(NBD_HAS_CONFIG_REF, &nbd->config->runtime_flags))