From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Teigland Subject: Re: [PATCH 12/16] GFS2: Mounting & sysfs interface Date: Tue, 25 Apr 2006 13:04:33 -0500 Message-ID: <20060425180433.GA17525@redhat.com> References: <1145636505.3856.116.camel@quoit.chygwyn.com> <444E53FC.5060100@oktetlabs.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Steven Whitehouse , Andrew Morton , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Return-path: Received: from mx1.redhat.com ([66.187.233.31]:4268 "EHLO mx1.redhat.com") by vger.kernel.org with ESMTP id S932103AbWDYSEC (ORCPT ); Tue, 25 Apr 2006 14:04:02 -0400 To: "Artem B. Bityutskiy" Content-Disposition: inline In-Reply-To: <444E53FC.5060100@oktetlabs.ru> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Tue, Apr 25, 2006 at 08:53:16PM +0400, Artem B. Bityutskiy wrote: > Hello, > > last time I tried to use "bare" sysfs functions to create my sysfs > hierarchy I ended up with a problem that the module refcount is not > increased when those sysfs files are opened. So I could open a sysfs > file from userspace, do rmmod and enjoy oops. > > Then I started using the class and class_device stuff, which have an > .owner field, and all became fine. > > I'm not sure if this is a problem of sysfs, but I suspect it could take > care of module refcount better. > > In your patch, I looked for THIS_MODULE pattern and did not find. I did > not try, but I suspect your code is not devoid of the problem I > described. So, this is just FYI and may be not the case. Others have also alluded to /sys/fs/ races that we'll probably need to resolve. In this case the question is more about umount than rmmod since the mount should reference the module. Thanks, Dave