SHARE
TWEET

bdi mishandling patch

a guest Dec 10th, 2018 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. diff -u a/block/blk-core.c b/block/blk-core.c
  2. --- a/block/blk-core.c      2017-02-26 05:08:29.000000000 -0500
  3. +++ b/block/blk-core.c      2018-12-06 11:54:54.109695294 -0500
  4. @@ -595,8 +595,6 @@
  5.                 q->queue_lock = &q->__queue_lock;
  6.         spin_unlock_irq(lock);
  7.  
  8. -       bdi_unregister(&q->backing_dev_info);
  9. -
  10.         /* @q is and will stay empty, shutdown and put */
  11.         blk_put_queue(q);
  12.  }
  13. diff -u a/block/genhd.c b/block/genhd.c
  14. --- a/block/genhd.c 2017-02-26 05:08:29.000000000 -0500
  15. +++ b/block/genhd.c 2018-12-06 17:53:00.777695294 -0500
  16. @@ -656,7 +656,16 @@
  17.         disk->flags &= ~GENHD_FL_UP;
  18.  
  19.         sysfs_remove_link(&disk_to_dev(disk)->kobj, "bdi");
  20. -       blk_unregister_queue(disk);
  21. +       if (disk->queue) {
  22. +               /*
  23. +                * Unregister bdi before releasing device numbers (as they can
  24. +                * get reused and we'd get clashes in sysfs).
  25. +                */
  26. +               bdi_unregister(&disk->queue->backing_dev_info);
  27. +               blk_unregister_queue(disk);
  28. +       } else {
  29. +               WARN_ON(1);
  30. +       }
  31.        blk_unregister_region(disk_devt(disk), disk->minors);
  32.  
  33.        part_stat_set_all(&disk->part0, 0);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top