Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S265646AbUAGV4Z (ORCPT ); Wed, 7 Jan 2004 16:56:25 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S265652AbUAGV4Z (ORCPT ); Wed, 7 Jan 2004 16:56:25 -0500 Received: from mail.kroah.org ([65.200.24.183]:29879 "EHLO perch.kroah.org") by vger.kernel.org with ESMTP id S265646AbUAGV4Y (ORCPT ); Wed, 7 Jan 2004 16:56:24 -0500 Date: Wed, 7 Jan 2004 13:56:24 -0800 From: Greg KH To: Alan Stern Cc: Kernel development list , Patrick Mochel Subject: Re: Inconsistency in sysfs behavior? Message-ID: <20040107215624.GC1083@kroah.com> References: <20040107172750.GC31177@kroah.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1208 Lines: 28 On Wed, Jan 07, 2004 at 04:50:24PM -0500, Alan Stern wrote: > On Wed, 7 Jan 2004, Greg KH wrote: > > > Because it is very difficult to determine when a user goes into a > > directory because we are using the ramfs/libfs code. It also does not > > cause any errors if the kobject is removed, as the vfs cleans up > > properly. > > > > Only when a file is opened does a kobject need to be pinned, due to > > possible errors that could happen. > > I had in mind approaching this the opposite way. Instead of trying to > make open directories also pin a kobject, why not make open attribute > files not pin them? > > It shouldn't be hard to avoid any errors; in fact I had a patch from some > time ago that would do the trick (although in a hacked-up kind of way). > The main idea is to return -ENXIO instead of calling the show()/store() > routines once the attribute has been removed. And you can do this without adding another lock, race free? greg k-h - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/