From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760067AbZE0Vi7 (ORCPT ); Wed, 27 May 2009 17:38:59 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755428AbZE0Vit (ORCPT ); Wed, 27 May 2009 17:38:49 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:54880 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1753736AbZE0Vis (ORCPT ); Wed, 27 May 2009 17:38:48 -0400 Date: Wed, 27 May 2009 17:38:50 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: "Eric W. Biederman" cc: Kay Sievers , James Bottomley , SCSI development list , Andrew Morton , Greg Kroah-Hartman , Kernel development list , Tejun Heo , Cornelia Huck , , "Eric W. Biederman" Subject: Re: [PATCH 25/20] sysfs: Only support removing emtpy sysfs directories. In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 27 May 2009, Eric W. Biederman wrote: > Alan Stern writes: > > > > > As fas as I know, they can't. Instead, they can cause the SCSI layer > > to unregister a sysfs directory containing a child directory. :-) > > > > Basically, a user program can delay removal of the child (i.e., the > > target) directory indefinitely, because currently the target isn't > > unregistered when all its children are removed -- it's unregistered > > when all its children are _released_. > > Ok. Is this opens of /dev/sda1 and the like that are being held open by > userspace that are potentially causing problems? Yes, plus any other mechanism for preventing a struct device's refcount from going to 0. > I think I have the fix to that... The fix is to delete the target when its children are deleted, and not wait until the children are released. Alan Stern 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: Wed, 27 May 2009 17:38:50 -0400 (EDT) Message-ID: References: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Return-path: Received: from iolanthe.rowland.org ([192.131.102.54]:54878 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751170AbZE0Vis (ORCPT ); Wed, 27 May 2009 17:38:48 -0400 In-Reply-To: Sender: linux-scsi-owner@vger.kernel.org List-Id: linux-scsi@vger.kernel.org To: "Eric W. Biederman" Cc: Kay Sievers , James Bottomley , SCSI development list , Andrew Morton , Greg Kroah-Hartman , Kernel development list , Tejun Heo , Cornelia Huck , linux-fsdevel@vger.kernel.org, "Eric W. Biederman" On Wed, 27 May 2009, Eric W. Biederman wrote: > Alan Stern writes: > > > > > As fas as I know, they can't. Instead, they can cause the SCSI layer > > to unregister a sysfs directory containing a child directory. :-) > > > > Basically, a user program can delay removal of the child (i.e., the > > target) directory indefinitely, because currently the target isn't > > unregistered when all its children are removed -- it's unregistered > > when all its children are _released_. > > Ok. Is this opens of /dev/sda1 and the like that are being held open by > userspace that are potentially causing problems? Yes, plus any other mechanism for preventing a struct device's refcount from going to 0. > I think I have the fix to that... The fix is to delete the target when its children are deleted, and not wait until the children are released. Alan Stern