From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tejun Heo Subject: Re: [PATCH 08/14] sysfs: Perform renames under sysfs_mutex Date: Tue, 31 Jul 2007 20:10:59 +0900 Message-ID: <46AF18C3.8050109@suse.de> References: <1182446577.8138.29.camel@localhost> <46ADDC7F.1090306@sw.ru> <46ADE24E.8020502@suse.de> <46ADEE35.8000109@sw.ru> <46ADF003.3010100@suse.de> <46AEAF79.6080404@suse.de> <46AEBA87.6000400@suse.de> <46AEEF75.2030101@suse.de> <46AEEFA6.4000901@suse.de> <46AF17A1.2010203@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <46AF17A1.2010203-l3A5Bk7waGM@public.gmane.org> 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: "Eric W. Biederman" Cc: Linux Containers , Greg KH , Greg KH , Dave Hansen List-Id: containers.vger.kernel.org Tejun Heo wrote: > Eric W. Biederman wrote: >> This modifies sysfs_rename_dir to use sysfs_addrm_start/sysfs_addrm_finish >> making it more like the rest of the sysfs directory manipulation functions. >> >> This moves the entire rename operation inside of sysfs_mutex removing >> the need to grab i_mutex, and incidentally this kills one s_dentry use. >> >> Signed-off-by: Eric W. Biederman > > Looks good. > > Acked-by: Tejun Heo > Just one afterthought. addrm_start/finish are basically used as wrapper to lock both sysfs_mutex and i_mutex. It might be better to just open code them. sysfs_move_dir() has to open code locking anyway and IMHO it's better to keep rename and move look similar. Thanks. -- tejun