Signed-off-by: Christoph Hellwig <hch@lst.de>
*/
void delete_partition(struct block_device *part)
{
+ remove_inode_hash(part->bd_inode);
xa_erase(&part->bd_disk->part_tbl, part->bd_partno);
+ synchronize_rcu();
+
kobject_put(part->bd_holder_dir);
device_del(&part->bd_device);
-
- /*
- * Remove the block device from the inode hash, so that it cannot be
- * looked up any more even when openers still hold references.
- */
- remove_inode_hash(part->bd_inode);
-
put_device(&part->bd_device);
}