Re: [PATCH] Fix kobject_rename and !CONFIG_SYSFS v2

From: Eric W. Biederman
Date: Tue May 13 2008 - 16:51:00 EST


"Randy.Dunlap" <rdunlap@xxxxxxxxxxxx> 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 <ebiederm@xxxxxxxxxxxx>
>> ---
>> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/