From patchwork Wed May 16 18:36:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 10404649 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 39CB2601D2 for ; Wed, 16 May 2018 18:36:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2A2072866C for ; Wed, 16 May 2018 18:36:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1EB8028674; Wed, 16 May 2018 18:36:11 +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 B951C2866C for ; Wed, 16 May 2018 18:36:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750786AbeEPSgJ (ORCPT ); Wed, 16 May 2018 14:36:09 -0400 Received: from mail-qt0-f194.google.com ([209.85.216.194]:46062 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750759AbeEPSgJ (ORCPT ); Wed, 16 May 2018 14:36:09 -0400 Received: by mail-qt0-f194.google.com with SMTP id j42-v6so2381341qtj.12 for ; Wed, 16 May 2018 11:36:09 -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=UW0K5O12NftHWzXa28q8wb+oPgyFgFYpE12Ui9YMe04=; b=Tu+s+t9SbaX2uycWqjgpbVax4Lkgmstj4wT9pysRkTLyTyNFt6MA9mLSmfc4dXoaBS hNH4wCuXxqsVyLtVnO3zdbQN0w2uYyv5HzClX442U2UqGACdM2m0i6OWhZyEJkYU4IEv KiulaG441Enmq7RJ6VHRSG/X3zYok+DlVtaozswve/mzF22W2hPNXv7OU8WLPjo5l6RG OgJr5AMB18XapfvdoptccPyFBpDDi7bEaR756lu6IR9BYndIpI3qItQ7PWPykbAUHRx/ Wn94LLi9nMXZqmrC2T5UgRLuCzZFn18ohvB0SEOUpj74ytz2FY2s1j7VSmi0g2ZYQt8p 5tAw== 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=UW0K5O12NftHWzXa28q8wb+oPgyFgFYpE12Ui9YMe04=; b=HuxvwueoOoTreCX+gb1xBpz+CxTNwUp5M5efd1AB9aBpc0Q6CHKUHcSFNo5ozGyIu/ Vl1lUNCCuwQqcyF5+mGAe3IX6dgh9JkO8oAzZZ6gngcMtq6kLWEvoOIfaV4opWHbfRQy T76JqpMA95bjdEPBtHTs3eV5/UInyffy3EOvEqmjOPYeNeHMsRHDRd+SoOjisvrrMHNn I5I2ocKYKClHbk2wBnIryI05dgukstrPEeWZmxOGTyiIOFwx8CWZYlUe14AGDTt8G1vz sBztssvc9H9SiBIzNGAInNHxug2bmQKoJfMp2dUsEokvzNaJ/LaqE8CYWl/vlOwoC94Z c9+g== X-Gm-Message-State: ALKqPweMiFgdQ4IHeP6zm+X6vabApcTlndLBbDMeRgpBw7/X+sszqair H+3bST6wVlbNNsm1U84LKhmWhPbm X-Google-Smtp-Source: AB8JxZphS7TP84+KQrq5KGg6iHa/27ASArO4m+mHpA839iG9MAhAmIknEg9oVxWqgp9S3Wy93dTiMw== X-Received: by 2002:ac8:6d2:: with SMTP id j18-v6mr2173357qth.306.1526495768720; Wed, 16 May 2018 11:36:08 -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 p25-v6sm2436035qte.83.2018.05.16.11.36.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 16 May 2018 11:36:08 -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 2/5] nbd: do queue cleanup after del_gendisk Date: Wed, 16 May 2018 14:36:02 -0400 Message-Id: <20180516183605.16159-2-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 Apparently del_gendisk is actually supposed to happen first to cleanup the sysfs stuff. Signed-off-by: Josef Bacik --- drivers/block/nbd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index 7b7b6143a126..7e83d6364b35 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -173,9 +173,12 @@ static const struct device_attribute pid_attr = { static void nbd_dev_remove(struct nbd_device *nbd) { struct gendisk *disk = nbd->disk; + struct request_queue *q; + if (disk) { - blk_cleanup_queue(disk->queue); + q = disk->queue; del_gendisk(disk); + blk_cleanup_queue(q); blk_mq_free_tag_set(&nbd->tag_set); disk->private_data = NULL; put_disk(disk);