[PATCH v2] nvme: fix cdev lifetime

Christoph Hellwig hch at lst.de
Mon Jul 13 02:48:41 PDT 2026


On Mon, Jul 13, 2026 at 10:46:26AM +0100, John Garry wrote:
>>>   +	nvme_tryget_ns_head(head); /* Undone in nvme_cdev_rel() */
>> I think we need to do a real get and not a tryget here.
>>
>
> ok, np.
>
> Then I am going to propose adding nvme_get_ns_head() also. It can be used 
> elsewhere and it would match better with nvme_put_ns_head() (rather than 
> using kref_fget(&head->kref) here)

Fine with me.



More information about the Linux-nvme mailing list