<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/include/linux/kobject.h, branch v3.2.45</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.2.45</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.2.45'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2012-09-19T14:05:16Z</updated>
<entry>
<title>kobject: fix oops with "input0: bad kobj_uevent_env content in show_uevent()"</title>
<updated>2012-09-19T14:05:16Z</updated>
<author>
<name>Bjørn Mork</name>
<email>bjorn@mork.no</email>
</author>
<published>2012-09-02T13:41:34Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d9a6b7d813f592d6d8738418bc396eeaea65467c'/>
<id>urn:sha1:d9a6b7d813f592d6d8738418bc396eeaea65467c</id>
<content type='text'>
commit 60e233a56609fd963c59e99bd75c663d63fa91b6 upstream.

Fengguang Wu &lt;fengguang.wu@intel.com&gt; writes:

&gt; After the __devinit* removal series, I can still get kernel panic in
&gt; show_uevent(). So there are more sources of bug..
&gt;
&gt; Debug patch:
&gt;
&gt; @@ -343,8 +343,11 @@ static ssize_t show_uevent(struct device
&gt;                 goto out;
&gt;
&gt;         /* copy keys to file */
&gt; -       for (i = 0; i &lt; env-&gt;envp_idx; i++)
&gt; +       dev_err(dev, "uevent %d env[%d]: %s/.../%s\n", env-&gt;buflen, env-&gt;envp_idx, top_kobj-&gt;name, dev-&gt;kobj.name);
&gt; +       for (i = 0; i &lt; env-&gt;envp_idx; i++) {
&gt; +               printk(KERN_ERR "uevent %d env[%d]: %s\n", (int)count, i, env-&gt;envp[i]);
&gt;                 count += sprintf(&amp;buf[count], "%s\n", env-&gt;envp[i]);
&gt; +       }
&gt;
&gt; Oops message, the env[] is again not properly initilized:
&gt;
&gt; [   44.068623] input input0: uevent 61 env[805306368]: input0/.../input0
&gt; [   44.069552] uevent 0 env[0]: (null)

This is a completely different CONFIG_HOTPLUG problem, only
demonstrating another reason why CONFIG_HOTPLUG should go away.  I had a
hard time trying to disable it anyway ;-)

The problem this time is lots of code assuming that a call to
add_uevent_var() will guarantee that env-&gt;buflen &gt; 0.  This is not true
if CONFIG_HOTPLUG is unset.  So things like this end up overwriting
env-&gt;envp_idx because the array index is -1:

	if (add_uevent_var(env, "MODALIAS="))
		return -ENOMEM;
        len = input_print_modalias(&amp;env-&gt;buf[env-&gt;buflen - 1],
				   sizeof(env-&gt;buf) - env-&gt;buflen,
				   dev, 0);

Don't know what the best action is, given that there seem to be a *lot*
of this around the kernel.  This patch "fixes" the problem for me, but I
don't know if it can be considered an appropriate fix.

[ It is the correct fix for now, for 3.7 forcing CONFIG_HOTPLUG to
always be on is the longterm fix, but it's too late for 3.6 and older
kernels to resolve this that way - gregkh ]

Reported-by: Fengguang Wu &lt;fengguang.wu@intel.com&gt;
Signed-off-by: Bjørn Mork &lt;bjorn@mork.no&gt;
Tested-by: Fengguang Wu &lt;fengguang.wu@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>treewide: use __printf not __attribute__((format(printf,...)))</title>
<updated>2011-11-01T00:30:54Z</updated>
<author>
<name>Joe Perches</name>
<email>joe@perches.com</email>
</author>
<published>2011-11-01T00:11:33Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=b9075fa968a0a4347aef35e235e2995c0e57dddd'/>
<id>urn:sha1:b9075fa968a0a4347aef35e235e2995c0e57dddd</id>
<content type='text'>
Standardize the style for compiler based printf format verification.
Standardized the location of __printf too.

Done via script and a little typing.

$ grep -rPl --include=*.[ch] -w "__attribute__" * | \
  grep -vP "^(tools|scripts|include/linux/compiler-gcc.h)" | \
  xargs perl -n -i -e 'local $/; while (&lt;&gt;) { s/\b__attribute__\s*\(\s*\(\s*format\s*\(\s*printf\s*,\s*(.+)\s*,\s*(.+)\s*\)\s*\)\s*\)/__printf($1, $2)/g ; print; }'

[akpm@linux-foundation.org: revert arch bits]
Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
Cc: "Kirill A. Shutemov" &lt;kirill@shutemov.name&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>atomic: use &lt;linux/atomic.h&gt;</title>
<updated>2011-07-26T23:49:47Z</updated>
<author>
<name>Arun Sharma</name>
<email>asharma@fb.com</email>
</author>
<published>2011-07-26T23:09:06Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=60063497a95e716c9a689af3be2687d261f115b4'/>
<id>urn:sha1:60063497a95e716c9a689af3be2687d261f115b4</id>
<content type='text'>
This allows us to move duplicated code in &lt;asm/atomic.h&gt;
(atomic_inc_not_zero() for now) to &lt;linux/atomic.h&gt;

Signed-off-by: Arun Sharma &lt;asharma@fb.com&gt;
Reviewed-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: David Miller &lt;davem@davemloft.net&gt;
Cc: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Acked-by: Mike Frysinger &lt;vapier@gentoo.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>kobject.h: fix build when CONFIG_HOTPLUG is disabled</title>
<updated>2011-02-18T16:02:10Z</updated>
<author>
<name>Randy Dunlap</name>
<email>randy.dunlap@oracle.com</email>
</author>
<published>2011-02-07T05:57:18Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=b38360a284f8acab4ae431b387c05a4e19ff4129'/>
<id>urn:sha1:b38360a284f8acab4ae431b387c05a4e19ff4129</id>
<content type='text'>
When CONFIG_HOTPLUG is not enabled, the inline function add_uevent_var()
needs to have its __attribute__ before the function name/parameters,
otherwise there are syntax errors.

linux-next-20110207/include/linux/kobject.h:232: error: expected ',' or ';' before '{' token

Signed-off-by: Randy Dunlap &lt;randy.dunlap@oracle.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
</entry>
<entry>
<title>kobject: Add missing format attribute specifications</title>
<updated>2011-02-03T23:10:18Z</updated>
<author>
<name>Bart Van Assche</name>
<email>bvanassche@acm.org</email>
</author>
<published>2011-01-01T12:51:52Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=9b99b7f84ea520d2ecaf816bde247a1ad07e454e'/>
<id>urn:sha1:9b99b7f84ea520d2ecaf816bde247a1ad07e454e</id>
<content type='text'>
Several functions in &lt;linux/kobject.h&gt; accept printf-style arguments.
Some of these functions have been annotated with a format attribute
declaration while others have not been annotated. Add a format attribute
specification where it is missing.

Signed-off-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
</entry>
<entry>
<title>kobject: Introduce kset_find_obj_hinted.</title>
<updated>2010-10-22T17:16:44Z</updated>
<author>
<name>Robin Holt</name>
<email>holt@sgi.com</email>
</author>
<published>2010-09-29T19:00:54Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c25d1dfbd403209025df41a737f82ce8f43d93f5'/>
<id>urn:sha1:c25d1dfbd403209025df41a737f82ce8f43d93f5</id>
<content type='text'>
One call chain getting to kset_find_obj is:
  link_mem_sections()
    find_mem_section()
      kset_find_obj()

This is done during boot.  The memory sections were added in a linearly
increasing order and link_mem_sections tends to utilize them in that
same linear order.

Introduce a kset_find_obj_hinted which is passed the result of the
previous kset_find_obj which it uses for a quick "is the next object
our desired object" check before falling back to the old behavior.

Signed-off-by: Robin Holt &lt;holt@sgi.com&gt;
To: Robert P. J. Day &lt;rpjday@crashcourse.ca&gt;
Reviewed-by: KAMEZAWA Hiroyuki &lt;kamezawa.hiroyu@jp.fujitsu.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>kobject: Break the kobject namespace defs into their own header</title>
<updated>2010-08-24T01:12:46Z</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2010-08-11T14:01:02Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=8488a38f4d2f43bd55a3e0db4cd57a5bef3af6d6'/>
<id>urn:sha1:8488a38f4d2f43bd55a3e0db4cd57a5bef3af6d6</id>
<content type='text'>
Break the kobject namespace defs into their own header to avoid a header file
inclusion ordering problem between linux/sysfs.h and linux/kobject.h.

This fixes the build breakage on older versions of gcc.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Cc: Eric Biederman &lt;ebiederm@xmission.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>netns: Teach network device kobjects which namespace they are in.</title>
<updated>2010-05-21T16:37:32Z</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2010-05-05T00:36:45Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=608b4b9548dedf4185ca47edcaae4bff2ceb62de'/>
<id>urn:sha1:608b4b9548dedf4185ca47edcaae4bff2ceb62de</id>
<content type='text'>
The problem.  Network devices show up in sysfs and with the network
namespace active multiple devices with the same name can show up in
the same directory, ouch!

To avoid that problem and allow existing applications in network namespaces
to see the same interface that is currently presented in sysfs, this
patch enables the tagging directory support in sysfs.

By using the network namespace pointers as tags to separate out the
the sysfs directory entries we ensure that we don't have conflicts
in the directories and applications only see a limited set of
the network devices.

Signed-off-by: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Acked-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>sysfs: Comment sysfs directory tagging logic</title>
<updated>2010-05-21T16:37:31Z</updated>
<author>
<name>Serge E. Hallyn</name>
<email>serue@us.ibm.com</email>
</author>
<published>2010-05-03T21:23:15Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=be867b194a3ae3c680c29521287ae49b4d44d420'/>
<id>urn:sha1:be867b194a3ae3c680c29521287ae49b4d44d420</id>
<content type='text'>
Add some in-line comments to explain the new infrastructure, which
was introduced to support sysfs directory tagging with namespaces.
I think an overall description someplace might be good too, but it
didn't really seem to fit into Documentation/filesystems/sysfs.txt,
which appears more geared toward users, rather than maintainers, of
sysfs.

(Tejun, please let me know if I can make anything clearer or failed
altogether to comment something that should be commented.)

Signed-off-by: Serge E. Hallyn &lt;serue@us.ibm.com&gt;
Cc: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Cc: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>kobj: Add basic infrastructure for dealing with namespaces.</title>
<updated>2010-05-21T16:37:31Z</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2010-03-30T18:31:25Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=bc451f2058238013e1cdf4acd443c01734d332f0'/>
<id>urn:sha1:bc451f2058238013e1cdf4acd443c01734d332f0</id>
<content type='text'>
Move complete knowledge of namespaces into the kobject layer
so we can use that information when reporting kobjects to
userspace.

Signed-off-by: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
</feed>
