From patchwork Wed Feb 28 18:15:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10249213 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 E95E560384 for ; Wed, 28 Feb 2018 18:15:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EE69F28DED for ; Wed, 28 Feb 2018 18:15:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E322628DF1; Wed, 28 Feb 2018 18:15:41 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 57B0F28DEF for ; Wed, 28 Feb 2018 18:15:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753110AbeB1SPg (ORCPT ); Wed, 28 Feb 2018 13:15:36 -0500 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:61113 "EHLO esa3.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753086AbeB1SPf (ORCPT ); Wed, 28 Feb 2018 13:15:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1519841735; x=1551377735; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=S4s9yxeyu1/B1AYEe4aAU7ugAqMaXOIzB3rlXKIEfLs=; b=QbneJnJt3vCQ/S94ZhV4uq/IkpmTHsOxWMcYq4DoJw1+jFtNb5AEqJWg XSJT9IxVEYrhhjBWDmBdi6TNrrFTVTmb2va+85OQ7e1/I5gHa20ykzo33 Fc8hlCncSHT7BNvEWVQwS1zaMa07wTu+AE9kmzKqd3fmY/HGLAEoKjoI4 /OvWl2pr8g8ygH8ksUvHA9NWa46oZHtjUjIlVJcJvcSYAxPbIG7YALZlP rWLBBTqRdOsXezBS0giBMPqWs+hFA1yn2ojQDBqFNw3IRVgwz7m/Abiwh ClxmYSMoA8I1yYJnGa3ZdbDVinjJIVYqnazbtQg8GLf56KT4my86p/eAo w==; X-IronPort-AV: E=Sophos;i="5.47,406,1515427200"; d="scan'208";a="73123310" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 01 Mar 2018 02:15:34 +0800 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP; 28 Feb 2018 10:08:58 -0800 Received: from thinkpad-bart.sdcorp.global.sandisk.com (HELO thinkpad-bart.int.fusionio.com) ([10.11.171.236]) by uls-op-cesaip02.wdc.com with ESMTP; 28 Feb 2018 10:15:33 -0800 From: Bart Van Assche To: Jens Axboe Cc: linux-block@vger.kernel.org, Christoph Hellwig , Bart Van Assche , Josef Bacik , Shaohua Li , Omar Sandoval , Hannes Reinecke , Ming Lei Subject: [PATCH v5 1/6] block/loop: Delete gendisk before cleaning up the request queue Date: Wed, 28 Feb 2018 10:15:28 -0800 Message-Id: <20180228181533.29402-2-bart.vanassche@wdc.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180228181533.29402-1-bart.vanassche@wdc.com> References: <20180228181533.29402-1-bart.vanassche@wdc.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 Remove the disk, partition and bdi sysfs attributes before cleaning up the request queue associated with the disk. Signed-off-by: Bart Van Assche Reviewed-by: Johannes Thumshirn Reviewed-by: Joseph Qi Cc: Josef Bacik Cc: Shaohua Li Cc: Omar Sandoval Cc: Hannes Reinecke Cc: Ming Lei --- drivers/block/loop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/loop.c b/drivers/block/loop.c index d5fe720cf149..8b693fdd08dc 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -1864,8 +1864,8 @@ static int loop_add(struct loop_device **l, int i) static void loop_remove(struct loop_device *lo) { - blk_cleanup_queue(lo->lo_queue); del_gendisk(lo->lo_disk); + blk_cleanup_queue(lo->lo_queue); blk_mq_free_tag_set(&lo->tag_set); put_disk(lo->lo_disk); kfree(lo);