<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/net/tipc/ref.c, branch v3.0.61</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/net/tipc/ref.c?h=v3.0.61</id>
<link rel='self' href='https://git.amat.us/linux/atom/net/tipc/ref.c?h=v3.0.61'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2011-01-01T21:57:57Z</updated>
<entry>
<title>tipc: remove zeroing assignments to static global variables</title>
<updated>2011-01-01T21:57:57Z</updated>
<author>
<name>Allan Stephens</name>
<email>Allan.Stephens@windriver.com</email>
</author>
<published>2010-12-31T18:59:34Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=e3ec9c7d5eea9adf2c604c623c987360cc700b88'/>
<id>urn:sha1:e3ec9c7d5eea9adf2c604c623c987360cc700b88</id>
<content type='text'>
Cleans up TIPC's source code to eliminate the needless initialization
of static variables to zero.

These changes are purely cosmetic and do not alter the operation of TIPC
in any way.

Signed-off-by: Allan Stephens &lt;Allan.Stephens@windriver.com&gt;
Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tipc: cleanup various cosmetic whitespace issues</title>
<updated>2011-01-01T21:57:56Z</updated>
<author>
<name>Allan Stephens</name>
<email>Allan.Stephens@windriver.com</email>
</author>
<published>2010-12-31T18:59:32Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=0e65967e33be61e5f67727edd4ea829b47676fc0'/>
<id>urn:sha1:0e65967e33be61e5f67727edd4ea829b47676fc0</id>
<content type='text'>
Cleans up TIPC's source code to eliminate deviations from generally
accepted coding conventions relating to leading/trailing white space
and white space around commas, braces, cases, and sizeof.

These changes are purely cosmetic and do not alter the operation of TIPC
in any way.

Signed-off-by: Allan Stephens &lt;Allan.Stephens@windriver.com&gt;
Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tipc: cleanup function namespace</title>
<updated>2010-10-16T18:13:24Z</updated>
<author>
<name>stephen hemminger</name>
<email>shemminger@vyatta.com</email>
</author>
<published>2010-10-13T13:20:35Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=31e3c3f6f1f9b154981a0e6620df700463db30ee'/>
<id>urn:sha1:31e3c3f6f1f9b154981a0e6620df700463db30ee</id>
<content type='text'>
Do some cleanups of TIPC based on make namespacecheck
  1. Don't export unused symbols
  2. Eliminate dead code
  3. Make functions and variables local
  4. Rename buf_acquire to tipc_buf_acquire since it is used in several files

Compile tested only.
This make break out of tree kernel modules that depend on TIPC routines.

Signed-off-by: Stephen Hemminger &lt;shemminger@vyatta.com&gt;
Acked-by: Jon Maloy &lt;jon.maloy@ericsson.com&gt;
Acked-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tipc: fix lockdep warning on address assignment</title>
<updated>2010-03-16T21:15:45Z</updated>
<author>
<name>Neil Horman</name>
<email>nhorman@tuxdriver.com</email>
</author>
<published>2010-03-16T08:14:33Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=a2f46ee1ba5ee249ce2ca1ee7a7a0ac46529fb4f'/>
<id>urn:sha1:a2f46ee1ba5ee249ce2ca1ee7a7a0ac46529fb4f</id>
<content type='text'>
So in the forward porting of various tipc packages, I was constantly
getting this lockdep warning everytime I used tipc-config to set a network
address for the protocol:

[ INFO: possible circular locking dependency detected ]
2.6.33 #1
tipc-config/1326 is trying to acquire lock:
(ref_table_lock){+.-...}, at: [&lt;ffffffffa0315148&gt;] tipc_ref_discard+0x53/0xd4 [tipc]

but task is already holding lock:
(&amp;(&amp;entry-&gt;lock)-&gt;rlock#2){+.-...}, at: [&lt;ffffffffa03150d5&gt;] tipc_ref_lock+0x43/0x63 [tipc]

which lock already depends on the new lock.

the existing dependency chain (in reverse order) is:

-&gt; #1 (&amp;(&amp;entry-&gt;lock)-&gt;rlock#2){+.-...}:
[&lt;ffffffff8107b508&gt;] __lock_acquire+0xb67/0xd0f
[&lt;ffffffff8107b78c&gt;] lock_acquire+0xdc/0x102
[&lt;ffffffff8145471e&gt;] _raw_spin_lock_bh+0x3b/0x6e
[&lt;ffffffffa03152b1&gt;] tipc_ref_acquire+0xe8/0x11b [tipc]
[&lt;ffffffffa031433f&gt;] tipc_createport_raw+0x78/0x1b9 [tipc]
[&lt;ffffffffa031450b&gt;] tipc_createport+0x8b/0x125 [tipc]
[&lt;ffffffffa030f221&gt;] tipc_subscr_start+0xce/0x126 [tipc]
[&lt;ffffffffa0308fb2&gt;] process_signal_queue+0x47/0x7d [tipc]
[&lt;ffffffff81053e0c&gt;] tasklet_action+0x8c/0xf4
[&lt;ffffffff81054bd8&gt;] __do_softirq+0xf8/0x1cd
[&lt;ffffffff8100aadc&gt;] call_softirq+0x1c/0x30
[&lt;ffffffff810549f4&gt;] _local_bh_enable_ip+0xb8/0xd7
[&lt;ffffffff81054a21&gt;] local_bh_enable_ip+0xe/0x10
[&lt;ffffffff81454d31&gt;] _raw_spin_unlock_bh+0x34/0x39
[&lt;ffffffffa0308eb8&gt;] spin_unlock_bh.clone.0+0x15/0x17 [tipc]
[&lt;ffffffffa0308f47&gt;] tipc_k_signal+0x8d/0xb1 [tipc]
[&lt;ffffffffa0308dd9&gt;] tipc_core_start+0x8a/0xad [tipc]
[&lt;ffffffffa01b1087&gt;] 0xffffffffa01b1087
[&lt;ffffffff8100207d&gt;] do_one_initcall+0x72/0x18a
[&lt;ffffffff810872fb&gt;] sys_init_module+0xd8/0x23a
[&lt;ffffffff81009b42&gt;] system_call_fastpath+0x16/0x1b

-&gt; #0 (ref_table_lock){+.-...}:
[&lt;ffffffff8107b3b2&gt;] __lock_acquire+0xa11/0xd0f
[&lt;ffffffff8107b78c&gt;] lock_acquire+0xdc/0x102
[&lt;ffffffff81454836&gt;] _raw_write_lock_bh+0x3b/0x6e
[&lt;ffffffffa0315148&gt;] tipc_ref_discard+0x53/0xd4 [tipc]
[&lt;ffffffffa03141ee&gt;] tipc_deleteport+0x40/0x119 [tipc]
[&lt;ffffffffa0316e35&gt;] release+0xeb/0x137 [tipc]
[&lt;ffffffff8139dbf4&gt;] sock_release+0x1f/0x6f
[&lt;ffffffff8139dc6b&gt;] sock_close+0x27/0x2b
[&lt;ffffffff811116f6&gt;] __fput+0x12a/0x1df
[&lt;ffffffff811117c5&gt;] fput+0x1a/0x1c
[&lt;ffffffff8110e49b&gt;] filp_close+0x68/0x72
[&lt;ffffffff8110e552&gt;] sys_close+0xad/0xe7
[&lt;ffffffff81009b42&gt;] system_call_fastpath+0x16/0x1b

Finally decided I should fix this.  Its a straightforward inversion,
tipc_ref_acquire takes two locks in this order:
ref_table_lock
entry-&gt;lock

while tipc_deleteport takes them in this order:
entry-&gt;lock (via tipc_port_lock())
ref_table_lock (via tipc_ref_discard())

when the same entry is referenced, we get the above warning.  The fix is equally
straightforward.  Theres no real relation between the entry-&gt;lock and the
ref_table_lock (they just are needed at the same time), so move the entry-&gt;lock
aquisition in tipc_ref_acquire down, after we unlock ref_table_lock (this is
safe since the ref_table_lock guards changes to the reference table, and we've
already claimed a slot there.  I've tested the below fix and confirmed that it
clears up the lockdep issue

Signed-off-by: Neil Horman &lt;nhorman@tuxdriver.com&gt;
CC: Allan Stephens &lt;allan.stephens@windriver.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tipc: Eliminate improper use of TIPC_OK error code</title>
<updated>2008-07-15T05:44:01Z</updated>
<author>
<name>Allan Stephens</name>
<email>allan.stephens@windriver.com</email>
</author>
<published>2008-07-15T05:44:01Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=0e35fd5e5264bb46d1febbe9cd9aa08421c21a96'/>
<id>urn:sha1:0e35fd5e5264bb46d1febbe9cd9aa08421c21a96</id>
<content type='text'>
This patch corrects many places where TIPC routines indicated
successful completion by returning TIPC_OK instead of 0.
(The TIPC_OK symbol has the value 0, but it should only be used
in contexts that deal with the error code field of a TIPC
message header.)

Signed-off-by: Allan Stephens &lt;allan.stephens@windriver.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tipc: Fix race condition when creating socket or native port</title>
<updated>2008-05-12T22:42:28Z</updated>
<author>
<name>Allan Stephens</name>
<email>allan.stephens@windriver.com</email>
</author>
<published>2008-05-12T22:42:28Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=7ef43ebaa538e0cc9063cbf84593a05091bcace2'/>
<id>urn:sha1:7ef43ebaa538e0cc9063cbf84593a05091bcace2</id>
<content type='text'>
This patch eliminates the (very remote) chance of a crash resulting
from a partially initialized socket or native port unexpectedly
receiving a message.  Now, during the creation of a socket or native
port, the underlying generic port's lock is not released until all
initialization required to handle incoming messages has been done.

Signed-off-by: Allan Stephens &lt;allan.stephens@windriver.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>[TIPC]: Cleanup of TIPC reference table code</title>
<updated>2008-04-17T01:22:20Z</updated>
<author>
<name>Allan Stephens</name>
<email>allan.stephens@windriver.com</email>
</author>
<published>2008-04-17T01:22:20Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=bcff122d478b774f4fd5262f35eedebe2f2fb274'/>
<id>urn:sha1:bcff122d478b774f4fd5262f35eedebe2f2fb274</id>
<content type='text'>
This patch is a largely cosmetic cleanup of the TIPC reference
table code.
- The object reference field in each table entry is now single
  32-bit integer instead of a union of two 32-bit integers.
- Variable naming has been made more consistent.
- Error message output has been made more consistent.
- Useless #includes have been eliminated.

Signed-off-by: Allan Stephens &lt;allan.stephens@windriver.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>[TIPC]: Optimized initialization of TIPC reference table</title>
<updated>2008-04-17T01:21:47Z</updated>
<author>
<name>Allan Stephens</name>
<email>allan.stephens@windriver.com</email>
</author>
<published>2008-04-17T01:21:47Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=0089509826b4997c37f08dfbdfb96ee952096cc9'/>
<id>urn:sha1:0089509826b4997c37f08dfbdfb96ee952096cc9</id>
<content type='text'>
This patch modifies TIPC's reference table code to delay initializing
table entries until they are actually needed by applications.

Signed-off-by: Allan Stephens &lt;allan.stephens@windriver.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>[TIPC]: Remove inlining of reference table locking routines</title>
<updated>2008-04-17T01:21:16Z</updated>
<author>
<name>Allan Stephens</name>
<email>allan.stephens@windriver.com</email>
</author>
<published>2008-04-17T01:21:16Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=4784b7c348779e957c82ba638ba2ada5ad8502d8'/>
<id>urn:sha1:4784b7c348779e957c82ba638ba2ada5ad8502d8</id>
<content type='text'>
This patch converts the TIPC reference table locking routines
into non-inlined routines, since they are mainly called from
non-performance critical areas of TIPC and the added code
footprint incurred through inlining can no longer be justified.

Signed-off-by: Allan Stephens &lt;allan.stephens@windriver.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tipc: fix integer as NULL pointer sparse warnings in tipc</title>
<updated>2008-02-25T02:38:31Z</updated>
<author>
<name>Harvey Harrison</name>
<email>harvey.harrison@gmail.com</email>
</author>
<published>2008-02-25T02:38:31Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=5f2f40a92e007ec5b503db20f3f70cb331c64f65'/>
<id>urn:sha1:5f2f40a92e007ec5b503db20f3f70cb331c64f65</id>
<content type='text'>
net/tipc/cluster.c:145:2: warning: Using plain integer as NULL pointer
net/tipc/link.c:3254:36: warning: Using plain integer as NULL pointer
net/tipc/ref.c:151:15: warning: Using plain integer as NULL pointer
net/tipc/zone.c:85:2: warning: Using plain integer as NULL pointer

Signed-off-by: Harvey Harrison &lt;harvey.harrison@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
