From mboxrd@z Thu Jan 1 00:00:00 1970 From: sagi@grimberg.me (Sagi Grimberg) Date: Thu, 1 Sep 2016 12:31:51 +0300 Subject: [PATCH WIP/RFC v3 3/6] nvme_rdma: keep a ref on the ctrl during delete/flush In-Reply-To: <20160901083609.GC3703@lst.de> References: <20160901083609.GC3703@lst.de> Message-ID: On 01/09/16 11:36, Christoph Hellwig wrote: > On Tue, Aug 30, 2016@08:24:50PM +0300, Sagi Grimberg wrote: >> >>> - /* Queue controller deletion */ >>> + /* >>> + * Queue controller deletion. Keep a reference until all >>> + * work is flushed since delete_work will free the ctrl mem >>> + */ >>> + kref_get(&ctrl->ctrl.kref); >> >> kref_get_unless_zero? > > How could the refcount be zero here? If another del_ctrl is invoked while the first puts the final ref?