From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by mail19.linbit.com (LINBIT Mail Daemon) with ESMTP id E2677420169 for ; Fri, 21 May 2021 08:29:40 +0200 (CEST) Date: Fri, 21 May 2021 08:23:01 +0200 From: Christoph Hellwig To: Coly Li Message-ID: <20210521062301.GA10244@lst.de> References: <20210521055116.1053587-1-hch@lst.de> <20210521055116.1053587-13-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Cc: nvdimm@lists.linux.dev, Ulf Hansson , Mike Snitzer , linux-nvme@lists.infradead.org, Philipp Reisner , Max Filippov , dm-devel@redhat.com, Joshua Morris , drbd-dev@lists.linbit.com, linux-s390@vger.kernel.org, Dave Jiang , Maxim Levitsky , Vishal Verma , Christoph Hellwig , Christian Borntraeger , Geert Uytterhoeven , Matias Bjorling , Nitin Gupta , Vasily Gorbik , linux-xtensa@linux-xtensa.org, Alex Dubov , Heiko Carstens , linux-raid@vger.kernel.org, linux-bcache@vger.kernel.org, linux-block@vger.kernel.org, Philip Kelleher , Dan Williams , Jens Axboe , Chris Zankel , Song Liu , linux-mmc@vger.kernel.org, linux-m68k@lists.linux-m68k.org, Jim Paris , Minchan Kim , Lars Ellenberg , linuxppc-dev@lists.ozlabs.org Subject: Re: [Drbd-dev] [PATCH 12/26] bcache: convert to blk_alloc_disk/blk_cleanup_disk List-Id: "*Coordination* of development, patches, contributions -- *Questions* \(even to developers\) go to drbd-user, please." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Fri, May 21, 2021 at 02:15:32PM +0800, Coly Li wrote: > The above 2 lines are added on purpose to prevent an refcount > underflow. It is from commit 86da9f736740 ("bcache: fix refcount > underflow in bcache_device_free()"). > > Maybe add a parameter to blk_cleanup_disk() or checking (disk->flags & > GENHD_FL_UP) inside blk_cleanup_disk() ? Please take a look at patch 4 in the series.