From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752665AbbAOQGZ (ORCPT ); Thu, 15 Jan 2015 11:06:25 -0500 Received: from bombadil.infradead.org ([198.137.202.9]:39896 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752439AbbAOQGX (ORCPT ); Thu, 15 Jan 2015 11:06:23 -0500 Date: Thu, 15 Jan 2015 08:06:12 -0800 From: Christoph Hellwig To: Alan Stern Cc: Bart Van Assche , James Bottomley , Hannes Reinecke , "linux-scsi@vger.kernel.org" , Greg Kroah-Hartman , linux-kernel@vger.kernel.org Subject: Re: [PATCH for v3.19, v2] Avoid that sd_shutdown() triggers a kernel warning Message-ID: <20150115160612.GA31446@infradead.org> References: <20150114093302.GA17532@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 14, 2015 at 10:07:00AM -0500, Alan Stern wrote: > and the kernfs core insures that the underlying device won't be > deallocated while a sysfs method runs. It has a reference to keep it from beeing freed, but so far I can't find anything that prevents ->remove from beeing called while we are in or just before a method call. > > But this seems like a more generic problem, and at least a quick glance at > > the pci_driver methods seems like others don't have a good > > synchroniation of ->remove against random driver methods. > > Can you give one or two examples? I look at the sriov_configure PCI method, or the various sub-methods under pci_driver.err_handler.