From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762434AbZE0WTO (ORCPT ); Wed, 27 May 2009 18:19:14 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1759039AbZE0WSz (ORCPT ); Wed, 27 May 2009 18:18:55 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:46510 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751182AbZE0WSy (ORCPT ); Wed, 27 May 2009 18:18:54 -0400 Date: Wed, 27 May 2009 18:18:55 -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: > >> 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. > > I think I can do both. > > I am currently working on a patchset which at the VFS layer disconnects a > fd from an underlying device. It does the necessary use count tracking > and when the disconnect is done it returns. As part of the disconnect it > calls the release method. > > We already do this in at least sysfs, proc, sysctl, and sound. So I > figure it is time to move this into some generic code so we don't need > to duplicate the bugs and the insanities. > > Once merged it would take just a few lines of code to use this functionality. That's good, but it isn't enough to solve this problem. Even though user programs might not be able to pin the device by holding the file open any more, other mechanisms (internal to the kernel) could have the same effect. Only a short delay is needed. The underlying cause should be fixed properly. 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 18:18:55 -0400 (EDT) Message-ID: References: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Return-path: In-Reply-To: Sender: linux-kernel-owner@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" List-Id: linux-scsi@vger.kernel.org On Wed, 27 May 2009, Eric W. Biederman wrote: > >> 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. > > I think I can do both. > > I am currently working on a patchset which at the VFS layer disconnects a > fd from an underlying device. It does the necessary use count tracking > and when the disconnect is done it returns. As part of the disconnect it > calls the release method. > > We already do this in at least sysfs, proc, sysctl, and sound. So I > figure it is time to move this into some generic code so we don't need > to duplicate the bugs and the insanities. > > Once merged it would take just a few lines of code to use this functionality. That's good, but it isn't enough to solve this problem. Even though user programs might not be able to pin the device by holding the file open any more, other mechanisms (internal to the kernel) could have the same effect. Only a short delay is needed. The underlying cause should be fixed properly. Alan Stern