From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan Stern Subject: Re: [PATCH 25/20] sysfs: Only support removing emtpy sysfs directories. Date: Thu, 28 May 2009 17:04:59 -0400 (EDT) Message-ID: References: <1243541439.2830.21.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: Hannes Reinecke , Kay Sievers , SCSI development list , "Eric W. Biederman" , Andrew Morton , Greg Kroah-Hartman , Kernel development list , Tejun Heo , Cornelia Huck , , "Eric W. Biederman" To: James Bottomley Return-path: Received: from iolanthe.rowland.org ([192.131.102.54]:56657 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1758906AbZE1VE7 (ORCPT ); Thu, 28 May 2009 17:04:59 -0400 In-Reply-To: <1243541439.2830.21.camel@localhost.localdomain> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thu, 28 May 2009, James Bottomley wrote: > > How so? Why not unlink the target from the host's list when the > > device_del() call returns? A new target can be created any time after > > that, since the old one is now completely invisible. > > The answer to that one is several emails back: we need the target in the > host list for the lifetime of the devices ... it's alterable, but even > more auditing. I don't recall you mentioning that the target had to be linked into the host's list for the lifetime of the devices; I thought you said merely that the target had to _exist_ for the lifetime of the devices. Does it really need to be linked, or is existence of the structure sufficient? Likewise, after a device is removed from visibility, does it need to remain linked into the host's and target's lists? > > P.S.: Does scsi_target_reap() really ever get called in non-process > > context? I couldn't find any place where that might happen. > > From the device release, which is done by last put, which could be I/O > context. But scsi_target_reap() isn't called directly from the device release. It's called from scsi_device_dev_release_usercontext(). And besides, in the patch I'm working on it isn't called from either of those places -- it's called from __scsi_remove_device(). So I'll go ahead and get rid of scsi_target_reap_usercontext(). Alan Stern