diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2017-04-03 06:24:50 -0700 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-04-03 06:24:50 -0700 |
| commit | 9af69213de642f19b19f77e04f23de9f66b6b0f0 (patch) | |
| tree | 8cd502e405b5a1c43b484f86f9586c13fbe21a54 | |
| parent | bb6316a190cc85136b171705c9573da29dcccb7f (diff) | |
| parent | 5d9a2c9e5e3176a35d1d82d82071b686aaaef62f (diff) | |
Merge "block: Move bdi_unregister() to del_gendisk()"
| -rw-r--r-- | block/blk-core.c | 2 | ||||
| -rw-r--r-- | block/genhd.c | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/block/blk-core.c b/block/blk-core.c index 4162327d8804..500447be3db4 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -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); } diff --git a/block/genhd.c b/block/genhd.c index fad9db981675..dae7c9ed87e5 100644 --- a/block/genhd.c +++ b/block/genhd.c @@ -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); |
