From patchwork Fri Feb 23 01:08:05 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: 10236721 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 16D6E60349 for ; Fri, 23 Feb 2018 01:08:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0FA9B28E0F for ; Fri, 23 Feb 2018 01:08:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 04D7728E50; Fri, 23 Feb 2018 01:08:14 +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 78DE228E10 for ; Fri, 23 Feb 2018 01:08:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751155AbeBWBIM (ORCPT ); Thu, 22 Feb 2018 20:08:12 -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 S1751276AbeBWBIK (ORCPT ); Thu, 22 Feb 2018 20:08:10 -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=vsMgX5R0AL9xB/HGeY9NaYCc9Gzu+jdWN5Nu80MOQ9o=; b=bfvDc3o1lMlnWQ1XXMRB9xoG9ewWSVC5N3upr/JropHThubMeYljVO2R nW6SiPDSlUe8v4Lj1QuKPXB9ujp+CePW98n66l2wQR+Wj2GMs0F1KpUdT YVD6Xkvy+TE1jX6yvkc4eoEpCBxBdZaKWHD/DzgLwmKPbDo57vOQz2BS9 MhbcnqlxTdH5QtDZYrH+Jg50rD+lcz81QFkfimFpCejD3vESijSaNLtUq BmL+jPlfJLrsZx1H7Qp3s30uvwPNcTYBcls1DxqrLnTkrcPni1srt7dCC MM9ET7ZMKybisbka9K70OPm7vbI8768jSwgU/7/ziNTnoLka5pS5Q57z1 Q==; X-IronPort-AV: E=Sophos;i="5.47,381,1515427200"; d="scan'208";a="175024053" 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:10 -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 v4 3/6] zram: Delete gendisk before cleaning up the request queue Date: Thu, 22 Feb 2018 17:08:05 -0800 Message-Id: <20180223010808.25765-4-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: Minchan Kim Cc: Nitin Gupta Cc: Sergey Senozhatsky Reviewed-by: Johannes Thumshirn Reviewed-by: Joseph Qi --- 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;