# Re: \[PATCH 04/26\] block: add a flag to make put\_disk on partially initalized disks safer

- From: Hannes Reinecke \<hare@suse.de\>
- Date: 2021-05-23 07:54:11 
- List: linux-block
- Page: https://ratatoskr.run/linux-block/2021/05/6402868
- Thread: https://ratatoskr.run/linux-block/2021/05/6402806/t.md

```text
On 5/21/21 7:50 AM, Christoph Hellwig wrote:
> Add a flag to indicate that __device_add_disk did grab a queue reference
> so that disk_release only drops it if we actually had it.  This sort
> out one of the major pitfals with partially initialized gendisk that
                       pitfalls

> a lot of drivers did get wrong or still do.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>   block/genhd.c         | 7 +++++--
>   include/linux/genhd.h | 1 +
>   2 files changed, 6 insertions(+), 2 deletions(-)
>
Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                Kernel Storage Architect
hare@suse.de                              +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer
```
