From: Jan Kara Date: Tue, 21 Feb 2017 17:09:47 +0000 (+0100) Subject: block: Unhash also block device inode for the whole device X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d06e05c026ab58121dc6ab37c11f855ff642531e;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 --- diff --git a/block/genhd.c b/block/genhd.c index 15b3c18d8337..2f444b87a5f2 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;