Merge "block: Move bdi_unregister() to del_gendisk()"

This commit is contained in:
Linux Build Service Account 2017-04-03 06:24:50 -07:00 committed by Gerrit - the friendly Code Review server
commit 9af69213de
2 changed files with 5 additions and 2 deletions

View file

@ -609,8 +609,6 @@ void blk_cleanup_queue(struct request_queue *q)
q->queue_lock = &q->__queue_lock;
spin_unlock_irq(lock);
bdi_unregister(&q->backing_dev_info);
/* @q is and will stay empty, shutdown and put */
blk_put_queue(q);
}

View file

@ -656,6 +656,11 @@ void del_gendisk(struct gendisk *disk)
disk->flags &= ~GENHD_FL_UP;
sysfs_remove_link(&disk_to_dev(disk)->kobj, "bdi");
/*
* Unregister bdi before releasing device numbers (as they can get
* reused and we'd get clashes in sysfs).
*/
bdi_unregister(&disk->queue->backing_dev_info);
blk_unregister_queue(disk);
blk_unregister_region(disk_devt(disk), disk->minors);