From mboxrd@z Thu Jan 1 00:00:00 1970 From: Greg KH Subject: Re: [PATCH] sysfs: Make sysfs_rename safe with sysfs_dirents in rbtrees. Date: Tue, 1 Nov 2011 14:19:15 -0700 Message-ID: <20111101211915.GA20290@suse.de> References: <20111025.063206.2273357152859701628.davem@davemloft.net> <20111025131315.GA1899@suse.de> <4EAC8642.3050309@suse.cz> <4EADB864.3060702@suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Linus Torvalds , Jiri Slaby , David Miller , Mikulas Patocka , akpm@linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jiri Slaby To: "Eric W. Biederman" Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org On Tue, Nov 01, 2011 at 07:06:17AM -0700, Eric W. Biederman wrote: > > In sysfs_rename remove the optimization of not calling sysfs_unlink_sibling > and sysfs_link_sibling if the renamed parent directory is not changing. > This optimization is no longer valid now that sysfs dirents are stored in an > rbtree sorted by name. > > Move the assignment of s_ns before the call of sysfs_link_sibling. With no > sysfs_dirent fields changing after the call of sysfs_link_sibling this allows > sysfs_link_sibling to take any of the directory entries into account when > it builds the rbtrees, and s_ns looks like a prime canidate to be used > in the rbtree in the future. > > Signed-off-by: Eric W. Biederman Looks good, Linus, thanks for taking this in your tree already. greg k-h