# Re: \[PATCH 1/2\] block: grab a device refcount in disk\_uevent

- From: Christoph Hellwig \<hch@lst.de\>
- Date: 2021-07-01 09:49:20 
- List: linux-block
- Page: https://ratatoskr.run/linux-block/2021/07/6403749
- Thread: https://ratatoskr.run/linux-block/2021/07/6403741/t.md

```text
On Thu, Jul 01, 2021 at 05:27:37PM +0800, Ming Lei wrote:
> 
> Maybe the reason is that sending uevent needs the device/kobject not
> 'released' in viewpoint of driver core world, other device resource(such
> as device name) may be referred but have been freed.
> 
> If that is the reason, this patch looks fine, and
> kobject_get_unless_zero() may be replaced with get_device() since the
> referred memory isn't freed yet.

Yes, sorry.  Braino while looking up the cause.  But there isn't much
of a point in sending a uevent to a partition already deleted, so
I think the unless_zero here still makes sense.
```
