From patchwork Wed May 16 18:51:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 10404667 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 8CD486037D for ; Wed, 16 May 2018 18:51:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7D62A28396 for ; Wed, 16 May 2018 18:51:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 71EAC28384; Wed, 16 May 2018 18:51:33 +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 1656428396 for ; Wed, 16 May 2018 18:51:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751198AbeEPSvc (ORCPT ); Wed, 16 May 2018 14:51:32 -0400 Received: from mail-qk0-f195.google.com ([209.85.220.195]:32838 "EHLO mail-qk0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750935AbeEPSvb (ORCPT ); Wed, 16 May 2018 14:51:31 -0400 Received: by mail-qk0-f195.google.com with SMTP id c11-v6so1552875qkm.0 for ; Wed, 16 May 2018 11:51:30 -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=vUz2gcvUX5iEpuUsxaj154fdVJd/p8pxwrag9FmIJJg=; b=FSh6TxUm/8PvhdKWve0wYws4QQLAfrB8T4z87P/IocwJcYT0OkKSLzLqIzuS6QF/oj LNoJGONoGhnv6wkn2CnLOWIp5Mk214BvDStTopcEfMCqKWi1BsJgjMg94UQxY5EkeH4v wjeYmkgpkjpKjA6KIiAgXHQcoJWzfPf1kEEwLs2cL5tybMAGfmptO0dy+3mgO+Bn2rxS lu/UHSKewt2JzVskpBUyuP8lkITB0w9RxD146KsOXWqLbjJQt8GWWjkaqfL5mtO0V1KH OXMbRkKSMevnUD66oHX0iIHKDFgXS36AzeSumajkD8fH0YrQN3y7iFkYnsr9sX9w67gy msjw== 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=vUz2gcvUX5iEpuUsxaj154fdVJd/p8pxwrag9FmIJJg=; b=OzdY21yHxmKSBbIOkOusBrRxiqQzdIxN8470o+lqv1ldbVDb2p8J8/+rW5JeIeOsQr KO8m1JvZGYXD7l6NGWC2Al8OxkrtwVt95xaImEmaIvWkgwtQCuek9fx+3QBtWlkHNvFs AQMRmc2RVwxMB3uvRHExeMq/lMJzqXF7VUcRFfnmxfrqFBtQbdYrh3bUk5oR5gNw4B/x esikFXupluWogBqgSY/oTaWSbfuFMzNuODYLEVZcjMq8I9MJelr/YCcG+HBBpl/bbDe8 7r2YsSSbkn+A5mocnbXNP1aXowvvi0OwaRrGLUXH3WTGUp3lW8RFN5IZHdnfmPOZxxfm leVQ== X-Gm-Message-State: ALKqPwd8cA8hLCBH1L15WiHqjt1vv+6JMxkLczfBxmCq0fy+sozrfN3o EGMZ02Ff9VKRq8WmgRZmzepx3A== X-Google-Smtp-Source: AB8JxZpIOlpYMcfvR0AXgBwHsotLe/fpbLX2+64Dn4R6QbgoyvUtq8/JbXXnQaki/BXE4o9lwZRbpw== X-Received: by 2002:a37:bcc2:: with SMTP id m185-v6mr2109601qkf.367.1526496690419; Wed, 16 May 2018 11:51:30 -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 d190-v6sm2419415qka.24.2018.05.16.11.51.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 16 May 2018 11:51:29 -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 5/7] nbd: clear_sock on netlink disconnect Date: Wed, 16 May 2018 14:51:20 -0400 Message-Id: <20180516185122.18590-5-josef@toxicpanda.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180516185122.18590-1-josef@toxicpanda.com> References: <20180516185122.18590-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 64278f472efe..06725ce97593 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -1768,6 +1768,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))