[net-next,05/16] tipc: Don't record failed publication attempt as a success

Submitted by Paul Gortmaker on April 20, 2012, 9:05 p.m.


Message ID 1334955924-907-6-git-send-email-paul.gortmaker@windriver.com
State Accepted
Delegated to: David Miller
Headers show

Commit Message

Paul Gortmaker April 20, 2012, 9:05 p.m.
From: Allan Stephens <allan.stephens@windriver.com>

No longer increments counter of number of publications by a node
if an attempt to add a new publication fails. This prevents TIPC from
incorrectly blocking future publications because the configured maximum
number of publications has been reached.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
 net/tipc/name_table.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/net/tipc/name_table.c b/net/tipc/name_table.c
index bd80d80..5d70042 100644
--- a/net/tipc/name_table.c
+++ b/net/tipc/name_table.c
@@ -695,11 +695,12 @@  struct publication *tipc_nametbl_publish(u32 type, u32 lower, u32 upper,
-	table.local_publ_count++;
 	publ = tipc_nametbl_insert_publ(type, lower, upper, scope,
 				   tipc_own_addr, port_ref, key);
-	if (likely(publ))
+	if (likely(publ)) {
+		table.local_publ_count++;
+	}
 	return publ;