From d06e05c026ab58121dc6ab37c11f855ff642531e Mon Sep 17 00:00:00 2001 From: Jan Kara Date: Tue, 21 Feb 2017 18:09:47 +0100 Subject: block: Unhash also block device inode for the whole device 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. Tested-by: Lekshmi Pillai Acked-by: Tejun Heo Signed-off-by: Jan Kara Signed-off-by: Jens Axboe --- block/genhd.c | 1 + 1 file changed, 1 insertion(+) (limited to 'block/genhd.c') diff --git a/block/genhd.c b/block/genhd.c index 15b3c18d83379..2f444b87a5f24 100644 --- a/block/genhd.c +++ b/block/genhd.c @@ -676,6 +676,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; -- cgit v1.2.3