From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752217AbdAZNSA (ORCPT ); Thu, 26 Jan 2017 08:18:00 -0500 Received: from verein.lst.de ([213.95.11.211]:48957 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751843AbdAZNR6 (ORCPT ); Thu, 26 Jan 2017 08:17:58 -0500 Date: Thu, 26 Jan 2017 14:17:56 +0100 From: Christoph Hellwig To: Jan Kara Cc: Dan Williams , Thiago Jung Bauermann , Jens Axboe , Rabin Vincent , "linux-nvdimm@lists.01.org" , Linux Kernel Mailing List , linux-block@vger.kernel.org, Andi Kleen , Wei Fang , linux-fsdevel , Christoph Hellwig Subject: Re: [RFC PATCH v2 0/2] block: fix backing_dev_info lifetime Message-ID: <20170126131756.GA18649@lst.de> References: <148375097100.37020.495735345355345658.stgit@dwillia2-desk3.amr.corp.intel.com> <7780787.RVFXFXDN3H@morokweng> <20170126100653.GB17099@quack2.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170126100653.GB17099@quack2.suse.cz> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 26, 2017 at 11:06:53AM +0100, Jan Kara wrote: > Yeah, so my patches (and I suspect your as well), have a problem when the > backing_device_info stays around because blkdev inode still exists, device > gets removed (e.g. USB disk gets unplugged) but blkdev inode still stays > around (there doesn't appear to be anything that would be forcing blkdev > inode out of cache on device removal and there cannot be because different > processes may hold inode reference) and then some other device gets plugged > in and reuses the same MAJOR:MINOR combination. Things get awkward there, I > think we need to unhash blkdev inode on device removal but so far I didn't > make this work... The other option is to simply not release the dev_t until the backing_dev is gone.