Re: kobject: Fix kobject_rename and !CONFIG_SYSFS

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Eric W. Biederman <ebiederm@...>
Cc: Greg KH <greg@...>, Randy Dunlap <randy.dunlap@...>, Greg KH <gregkh@...>, Andrew Morton <akpm@...>, <linux-kernel@...>, Tejun Heo <htejun@...>, Al Viro <viro@...>, Daniel Lezcano <dlezcano@...>, Serge E. Hallyn <serue@...>, Pavel Emelyanov <xemul@...>, <netdev@...>
Date: Tuesday, May 13, 2008 - 10:25 am

Eric W. Biederman wrote:

Argh, headers "cross-dependencies":

* linux/kobject.h includes linux/sysfs.h before defining
   kobject_set_name()

* linux/sysfs.h needs to include linux/kobject.h to find
   kobject_set_name() definition (for inlined sysfs_rename_dir() when
   CONFIG_SYSFS=n)


sysfs_rename_dir() is only called by kobject.c, kobject_rename().
I guess this kind of patch is not acceptable to fix the depency?


Index: linux-2.6/lib/kobject.c
===================================================================
--- linux-2.6.orig/lib/kobject.c        2008-05-13 15:14:38.000000000 +0200
+++ linux-2.6/lib/kobject.c     2008-05-13 15:58:37.000000000 +0200
@@ -416,8 +416,11 @@ int kobject_rename(struct kobject *kobj,
         envp[0] = devpath_string;
         envp[1] = NULL;

+#ifdef CONFIG_SYSFS
         error = sysfs_rename_dir(kobj, new_name);
-
+#else
+       error = kobject_set_name(kobj, "%s", new_name);
+#endif
         /* This function is mostly/only used for network interface.
          * Some hotplug package track interfaces by their name and
          * therefore want to know when the name is changed by the user. */


-Benjamin



-- 
B e n j a m i n   T h e r y  - BULL/DT/Open Software R&D

    http://www.bull.com
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] Fix kobject_rename and !CONFIG_SYSFS, Eric W. Biederman, (Thu May 8, 5:41 pm)
Re: kobject: Fix kobject_rename and !CONFIG_SYSFS, Eric W. Biederman, (Tue May 13, 3:00 am)
Re: kobject: Fix kobject_rename and !CONFIG_SYSFS, Benjamin Thery, (Tue May 13, 10:25 am)
Re: kobject: Fix kobject_rename and !CONFIG_SYSFS, Greg KH, (Tue May 13, 12:44 pm)
Re: kobject: Fix kobject_rename and !CONFIG_SYSFS, Benjamin Thery , (Tue May 13, 3:33 pm)
Re: kobject: Fix kobject_rename and !CONFIG_SYSFS, Eric W. Biederman, (Tue May 13, 4:42 pm)
[PATCH] Fix kobject_rename and !CONFIG_SYSFS v2, Eric W. Biederman, (Tue May 13, 1:55 pm)
[PATCH] Fix kobject_rename and !CONFIG_SYSFS v3, Eric W. Biederman, (Tue May 13, 4:45 pm)
Re: [PATCH] Fix kobject_rename and !CONFIG_SYSFS v3, Randy Dunlap, (Tue May 13, 5:18 pm)
[PATCH] Fix kobject_rename and !CONFIG_SYSFS v4, Eric W. Biederman, (Wed May 14, 12:39 am)
Re: [PATCH] Fix kobject_rename and !CONFIG_SYSFS v4, Andrew Morton, (Wed May 14, 1:03 am)
Re: [PATCH] Fix kobject_rename and !CONFIG_SYSFS v4, Eric W. Biederman, (Wed May 14, 5:01 am)
Re: [PATCH] Fix kobject_rename and !CONFIG_SYSFS v4, Andrew Morton, (Wed May 14, 5:20 am)
Re: [PATCH] Fix kobject_rename and !CONFIG_SYSFS v4, Benjamin Thery, (Wed May 14, 5:51 am)
Re: [PATCH] Fix kobject_rename and !CONFIG_SYSFS v4, Andrew Morton, (Wed May 14, 5:56 am)
Re: [PATCH] Fix kobject_rename and !CONFIG_SYSFS v2, Randy.Dunlap, (Tue May 13, 2:23 pm)
Re: [PATCH] Fix kobject_rename and !CONFIG_SYSFS v2, Eric W. Biederman, (Tue May 13, 4:43 pm)
[PATCH] wireless: Add missing locking to cfg80211_dev_rename, Eric W. Biederman, (Thu May 8, 5:30 pm)