From patchwork Wed Feb 28 18:15:30 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: 10249219 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 B238160384 for ; Wed, 28 Feb 2018 18:15:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B6C1E28DEC for ; Wed, 28 Feb 2018 18:15:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AB7F328DEF; Wed, 28 Feb 2018 18:15:45 +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 3E45828DEC for ; Wed, 28 Feb 2018 18:15:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932251AbeB1SPm (ORCPT ); Wed, 28 Feb 2018 13:15:42 -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 S1753053AbeB1SPf (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=1519841736; x=1551377736; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=yH3J5LksJ+iLETStVOiX7rwv0lrCfA40EoQi078Bp8s=; b=flSgDIA0unmpxdbKINe08OzSg2WQlr8obr1cPT8BwiHBLvfesHGmn6sH wyJXHrzNHgSx9TJuMNzsL3XdHKWQTMOS52BVE8y3i2tzj+mTH02d820vn Q8KYNK9GqwKZuDNIqnviXI9UErOKwRcWx4Ha65Bja/8oYcG8OqsyAEEe2 oSw6oHfOmLM+knWNg1jP5GwQruP7f1YN191ONCy74/Z8CMOCtTB+DrNQD HZu8Xr7M/A/MKXB3ShU18nyD5uaPBVa67dqT2ElSbdOOiebkM9sX+JM/3 ywXg026bRpqrfIgZRG1wQjhnotM9sFNsRhMNc6aSmPGOzVJlidftoRA9X Q==; X-IronPort-AV: E=Sophos;i="5.47,406,1515427200"; d="scan'208";a="73123313" 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 , Minchan Kim , Nitin Gupta , Sergey Senozhatsky Subject: [PATCH v5 3/6] zram: Delete gendisk before cleaning up the request queue Date: Wed, 28 Feb 2018 10:15:30 -0800 Message-Id: <20180228181533.29402-4-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: Minchan Kim Cc: Nitin Gupta Cc: Sergey Senozhatsky --- drivers/block/zram/zram_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index 0afa6c8c3857..85110e7931e5 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -1620,8 +1620,8 @@ static int zram_remove(struct zram *zram) pr_info("Removed device: %s\n", zram->disk->disk_name); - blk_cleanup_queue(zram->disk->queue); del_gendisk(zram->disk); + blk_cleanup_queue(zram->disk->queue); put_disk(zram->disk); kfree(zram); return 0;