From patchwork Fri Feb 23 01:08:03 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: 10236719 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 CB42B602A0 for ; Fri, 23 Feb 2018 01:08:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C39BF28E0F for ; Fri, 23 Feb 2018 01:08:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B897028E76; Fri, 23 Feb 2018 01:08:13 +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 7FE7428E0F for ; Fri, 23 Feb 2018 01:08:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751314AbeBWBIK (ORCPT ); Thu, 22 Feb 2018 20:08:10 -0500 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:61504 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751158AbeBWBIJ (ORCPT ); Thu, 22 Feb 2018 20:08:09 -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=1519348089; x=1550884089; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=UvQOwC/LO+vulKSUXqyr3IcUq1N3IgGO2/Iqx9HuStQ=; b=nL0sFLRWGU8cgJUwMl2kU1qnF06vq0/TMvANQhjkc5hZqsRc3OEHEDdD iMxg/2DkcsUGk4A2L/cjPoRq1agEGIcfWr4bOAvt2/lFD2vd7ZJCkrj9S 8fyWMXmkOS6nH/fsuxlMD1rWN4jGbiRsTN3z35NJJGFH8jx65LNaeK7pL WdfYOCulW//vX/+BCeBE28HxTXtTQ6fSZoD7F1F7XmnLculiDZS6uIjay REuA7wK+NZhLC0NolWxEP+7qKgHCgsLEohWvvFnR8ZrBIXsBPgq/SM1ma 5U4oSrdjlc4Lze2zGOOL/AT6b5eBD5bs8T6EpA7Zsm0ieopxRImWo5M4l Q==; X-IronPort-AV: E=Sophos;i="5.47,381,1515427200"; d="scan'208";a="175024050" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 23 Feb 2018 09:08:08 +0800 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP; 22 Feb 2018 17:02:25 -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; 22 Feb 2018 17:08:09 -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 v4 1/6] block/loop: Delete gendisk before cleaning up the request queue Date: Thu, 22 Feb 2018 17:08:03 -0800 Message-Id: <20180223010808.25765-2-bart.vanassche@wdc.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180223010808.25765-1-bart.vanassche@wdc.com> References: <20180223010808.25765-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 Cc: Josef Bacik Cc: Shaohua Li Cc: Omar Sandoval Cc: Hannes Reinecke Cc: Ming Lei Reviewed-by: Johannes Thumshirn Reviewed-by: Joseph Qi --- 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);