Return-Path: Return-Path: Subject: Re: [PATCH 10/17] nvme: switch controller refcounting to use struct device To: Christoph Hellwig , Jens Axboe Cc: Keith Busch , Hannes Reinecke , Johannes Thumshirn , linux-nvme@lists.infradead.org, linux-block@vger.kernel.org References: <20171018165258.23212-1-hch@lst.de> <20171018165258.23212-11-hch@lst.de> From: Sagi Grimberg Message-ID: Date: Thu, 19 Oct 2017 10:17:01 +0300 MIME-Version: 1.0 In-Reply-To: <20171018165258.23212-11-hch@lst.de> Content-Type: text/plain; charset=utf-8; format=flowed List-ID: > - if (!kref_get_unless_zero(&ctrl->ctrl.kref)) > - return -EBUSY; > + nvme_get_ctrl(&ctrl->ctrl); Given that we take this reference before we are protected with the state change I think this should still be get_unless_zero. Maybe we can introduce get_device_unless_zero() for this?