# fix a race between del\_gendisk and BLKRRPART v2

- From: Christoph Hellwig \<hch@lst.de\>
- Date: 2021-05-14 13:18:58 
- List: linux-block
- Page: https://ratatoskr.run/linux-block/2021/05/6402665
- Thread: https://ratatoskr.run/linux-block/2021/05/6402665/t.md

```text
Hi all,

this is based of a patch from Gulam and suggestions from Ming and fixes a
race between del_gendisk and BLKRRPART while also removing a global lock.

Changes since v1:
 - fix the GENHD_FL_UP check in __blkdev_get
 - don't change where remove_inode_hash is called for now
 - improve the commit message

Diffstat:
 block/genhd.c         |   11 +----------
 fs/block_dev.c        |   18 ++++++++----------
 include/linux/genhd.h |    2 --
 3 files changed, 9 insertions(+), 22 deletions(-)
```
