From mboxrd@z Thu Jan 1 00:00:00 1970 From: ebiederm@xmission.com (Eric W. Biederman) Subject: Re: [PATCH] Fix kobject_rename and !CONFIG_SYSFS v2 Date: Tue, 13 May 2008 13:43:57 -0700 Message-ID: References: <20080512220232.GA16914@kroah.com> <4829A4BD.3020007@bull.net> <20080513164438.GA31563@kroah.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "Eric W. Biederman" , Greg KH , Benjamin Thery , Randy Dunlap , Greg KH , Andrew Morton , linux-kernel@vger.kernel.org, Tejun Heo , Al Viro , Daniel Lezcano , "Serge E. Hallyn" , Pavel Emelyanov , netdev@vger.kernel.org To: "Randy.Dunlap" Return-path: Received: from out02.mta.xmission.com ([166.70.13.232]:42112 "EHLO out02.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758883AbYEMUuV (ORCPT ); Tue, 13 May 2008 16:50:21 -0400 In-Reply-To: (Randy Dunlap's message of "Tue, 13 May 2008 11:23:33 -0700 (PDT)") Sender: netdev-owner@vger.kernel.org List-ID: "Randy.Dunlap" writes: > On Tue, 13 May 2008, Eric W. Biederman wrote: > >> Changelog: >> v2: Added a declaration of kboject_set_name to sysfs.h >> so the code actually compiles with !CONFIG_SYSFS. >> >> Signed-off-by: Eric W. Biederman >> --- >> Documentation/kobject.txt | 4 ++++ >> drivers/base/core.c | 5 +++++ >> include/linux/sysfs.h | 4 +++- >> lib/kobject.c | 18 +++++------------- >> 4 files changed, 17 insertions(+), 14 deletions(-) >> >> diff --git a/Documentation/kobject.txt b/Documentation/kobject.txt >> index bf3256e..79184b4 100644 >> --- a/Documentation/kobject.txt >> +++ b/Documentation/kobject.txt >> @@ -118,6 +118,10 @@ the name of the kobject, call kobject_rename(): >> >> int kobject_rename(struct kobject *kobj, const char *new_name); >> >> +Note kobject_rename does perform any locking or have a solid notion of > > ^not > >> +what names are valid so the provide must provide their own sanity checking > ~~~~~~~ > caller > >> +and serialization. >> + >> There is a function called kobject_set_name() but that is legacy cruft and >> is being removed. If your code needs to call this function, it is >> incorrect and needs to be fixed. Good catch. Thanks Randy. Eric