From: ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org (Eric W. Biederman) Subject: Re: [PATCH 2/4] sysfs: Implement sysfs manged shadow directory support. Date: Mon, 30 Jul 2007 22:02:35 -0600 Message-ID: References: <1182446577.8138.29.camel@localhost> <20070621211637.GB10583@suse.de> <20070622001328.GA14113@suse.de> <20070625212339.GA13398@kroah.com> <46A3B449.3090409@gmail.com> <20070722202508.GA18018@suse.de> <46A425F9.1030008@gmail.com> <46AD8E92.7080002@suse.de> <46ADDC7F.1090306@sw.ru> <46ADE24E.8020502@suse.de> <46ADEE35.8000109@sw.ru> <46ADF003.3010100@suse.de> <46AEAF79.6080404@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: In-Reply-To: <46AEAF79.6080404-l3A5Bk7waGM@public.gmane.org> (Tejun Heo's message of "Tue, 31 Jul 2007 12:41:45 +0900") List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Tejun Heo Cc: Linux Containers , Greg KH , Greg KH , Dave Hansen List-Id: containers.vger.kernel.org Tejun Heo writes: > Hello, > > Eric W. Biederman wrote: >> Ugh. I need to step back and carefully define what I'm seeing but it >> looks like the current sysfs locking is wrong. >> >> I'm starting to find little inconsistencies all over the place >> such as: >> >> Which lock actually protects sd->s_children? >> - It isn't sysfs_mutex. (see sysfs_lookup) >> - It isn't inode->i_mutex (we only get it if we happen to have the inode >> in core) > > Yeah, I missed two places while converting to sysfs_mutex. > sysfs_lookup() and rename(). I'm about to post patch to fix it. Yes. Make certain to get the name change under sysfs_mutex while you are at it. What do we use inode->i_mutex for? I think we might be able to kill that. I'm starting to wonder if we can completely remove sysfs from grabbing inode->i_mutex. >> At first glance sysfs_assoc_lock looks just as bad. > > I think sysfs_assoc_lock is okay. It's tricky tho. Why do you think > it's bad? I'm still looking. I just have a weird vibe so far. sysfs_get_dentry is really nasty with respect to locking. Eric