From: Ying Xue <ying.xue@windriver.com>
To: <davem@davemloft.net>
Cc: <jon.maloy@ericsson.com>, <Paul.Gortmaker@windriver.com>,
<erik.hugne@ericsson.com>, <netdev@vger.kernel.org>,
<tipc-discussion@lists.sourceforge.net>
Subject: [PATCH net-next 2/2] tipc: don't directly overwrite node action_flags
Date: Thu, 8 May 2014 08:54:40 +0800 [thread overview]
Message-ID: <1399510480-29558-3-git-send-email-ying.xue@windriver.com> (raw)
In-Reply-To: <1399510480-29558-1-git-send-email-ying.xue@windriver.com>
Each node action flag should be set or cleared separately, instead
we now set the whole flags variable in one shot, and it's turned
out to be hard to see which other flags are affected. Therefore,
for instance, we explicitly clear TIPC_WAIT_OWN_LINKS_DOWN bit in
node_lost_contact().
Signed-off-by: Ying Xue <ying.xue@windriver.com>
Reviewed-by: Jon Maloy <jon.maloy@ericsson.com>
---
net/tipc/link.c | 2 +-
net/tipc/node.c | 6 ++++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/net/tipc/link.c b/net/tipc/link.c
index 26abb16..2140837 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -1853,7 +1853,7 @@ static void tipc_link_proto_rcv(struct tipc_link *l_ptr, struct sk_buff *buf)
* peer has lost contact -- don't allow peer's links
* to reactivate before we recognize loss & clean up
*/
- l_ptr->owner->action_flags = TIPC_WAIT_OWN_LINKS_DOWN;
+ l_ptr->owner->action_flags |= TIPC_WAIT_OWN_LINKS_DOWN;
}
link_state_event(l_ptr, RESET_MSG);
diff --git a/net/tipc/node.c b/net/tipc/node.c
index bb66a26..facd561 100644
--- a/net/tipc/node.c
+++ b/net/tipc/node.c
@@ -308,11 +308,13 @@ static void node_lost_contact(struct tipc_node *n_ptr)
tipc_link_reset_fragments(l_ptr);
}
+ n_ptr->action_flags &= ~TIPC_WAIT_OWN_LINKS_DOWN;
+
/* Notify subscribers and prevent re-contact with node until
* cleanup is done.
*/
- n_ptr->action_flags = TIPC_WAIT_PEER_LINKS_DOWN |
- TIPC_NOTIFY_NODE_DOWN;
+ n_ptr->action_flags |= TIPC_WAIT_PEER_LINKS_DOWN |
+ TIPC_NOTIFY_NODE_DOWN;
}
struct sk_buff *tipc_node_get_nodes(const void *req_tlv_area, int req_tlv_space)
--
1.7.9.5
next prev parent reply other threads:[~2014-05-08 0:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-08 0:54 [PATCH net-next 0/2] overhaul node action flags Ying Xue
2014-05-08 0:54 ` [PATCH net-next 1/2] tipc: rename enum names of node flags Ying Xue
2014-05-08 0:54 ` Ying Xue [this message]
2014-05-09 5:41 ` [PATCH net-next 0/2] overhaul node action flags David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1399510480-29558-3-git-send-email-ying.xue@windriver.com \
--to=ying.xue@windriver.com \
--cc=Paul.Gortmaker@windriver.com \
--cc=davem@davemloft.net \
--cc=erik.hugne@ericsson.com \
--cc=jon.maloy@ericsson.com \
--cc=netdev@vger.kernel.org \
--cc=tipc-discussion@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).