From patchwork Thu Feb 9 12:44:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kara X-Patchwork-Id: 9564501 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 A880660216 for ; Thu, 9 Feb 2017 13:04:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8EC762846D for ; Thu, 9 Feb 2017 13:04:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 83ADF28498; Thu, 9 Feb 2017 13:04:05 +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.9 required=2.0 tests=BAYES_00,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 3957A28489 for ; Thu, 9 Feb 2017 13:04:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751852AbdBINEC (ORCPT ); Thu, 9 Feb 2017 08:04:02 -0500 Received: from mx2.suse.de ([195.135.220.15]:35768 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751746AbdBIND5 (ORCPT ); Thu, 9 Feb 2017 08:03:57 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 20D18ADC4; Thu, 9 Feb 2017 12:44:49 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 1FECB1E0DE9; Thu, 9 Feb 2017 13:44:43 +0100 (CET) From: Jan Kara To: Jens Axboe Cc: linux-block@vger.kernel.org, Christoph Hellwig , Tejun Heo , Dan Williams , Thiago Jung Bauermann , NeilBrown , Jan Kara Subject: [PATCH 02/10] block: Unhash also block device inode for the whole device Date: Thu, 9 Feb 2017 13:44:25 +0100 Message-Id: <20170209124433.2626-3-jack@suse.cz> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20170209124433.2626-1-jack@suse.cz> References: <20170209124433.2626-1-jack@suse.cz> 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 Iteration over partitions in del_gendisk() omits part0. Add bdev_unhash_inode() call for the whole device. Otherwise if the device number gets reused, bdev inode will be still associated with the old (stale) bdi. Signed-off-by: Jan Kara Acked-by: Tejun Heo --- block/genhd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/genhd.c b/block/genhd.c index 6cb9f3a34a92..f6c4d4400759 100644 --- a/block/genhd.c +++ b/block/genhd.c @@ -655,6 +655,7 @@ void del_gendisk(struct gendisk *disk) disk_part_iter_exit(&piter); invalidate_partition(disk, 0); + bdev_unhash_inode(disk_devt(disk)); set_capacity(disk, 0); disk->flags &= ~GENHD_FL_UP;