From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753925AbdAZQkJ (ORCPT ); Thu, 26 Jan 2017 11:40:09 -0500 Received: from mail-oi0-f52.google.com ([209.85.218.52]:35389 "EHLO mail-oi0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753745AbdAZQkF (ORCPT ); Thu, 26 Jan 2017 11:40:05 -0500 MIME-Version: 1.0 In-Reply-To: <20170126131756.GA18649@lst.de> References: <148375097100.37020.495735345355345658.stgit@dwillia2-desk3.amr.corp.intel.com> <7780787.RVFXFXDN3H@morokweng> <20170126100653.GB17099@quack2.suse.cz> <20170126131756.GA18649@lst.de> From: Dan Williams Date: Thu, 26 Jan 2017 08:39:54 -0800 Message-ID: Subject: Re: [RFC PATCH v2 0/2] block: fix backing_dev_info lifetime To: Christoph Hellwig Cc: Jan Kara , 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 , Jej B Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 26, 2017 at 5:17 AM, Christoph Hellwig wrote: > 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. I came to a similar conclusion here: https://marc.info/?l=linux-scsi&m=147103737421897&w=4 James had some concerns, but I think its now clear this problem is bigger than something we can fix locally in scsi.