cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Alexander Aring <aahringo@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH dlm/next 7/8] fs: dlm: move state change into else branch
Date: Thu, 12 Jan 2023 17:18:48 -0500	[thread overview]
Message-ID: <20230112221849.1883104-8-aahringo@redhat.com> (raw)
In-Reply-To: <20230112221849.1883104-1-aahringo@redhat.com>

Currently we can switch at first into DLM_CLOSE_WAIT state and then do
another state change if a condition is true. Instead of doing two state
changes we handle the other state change inside an else branch of this
condition.

Signed-off-by: Alexander Aring <aahringo@redhat.com>
---
 fs/dlm/midcomms.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/fs/dlm/midcomms.c b/fs/dlm/midcomms.c
index b5720042ef9d..2a9177f3d468 100644
--- a/fs/dlm/midcomms.c
+++ b/fs/dlm/midcomms.c
@@ -506,9 +506,6 @@ static void dlm_midcomms_receive_buffer(union dlm_packet *p,
 			case DLM_ESTABLISHED:
 				dlm_send_ack(node->nodeid, node->seq_next);
 
-				node->state = DLM_CLOSE_WAIT;
-				pr_debug("switch node %d to state %s\n",
-					 node->nodeid, dlm_state_str(node->state));
 				/* passive shutdown DLM_LAST_ACK case 1
 				 * additional we check if the node is used by
 				 * cluster manager events at all.
@@ -519,6 +516,10 @@ static void dlm_midcomms_receive_buffer(union dlm_packet *p,
 						 node->nodeid, dlm_state_str(node->state));
 					set_bit(DLM_NODE_FLAG_STOP_RX, &node->flags);
 					dlm_send_fin(node, dlm_pas_fin_ack_rcv);
+				} else {
+					node->state = DLM_CLOSE_WAIT;
+					pr_debug("switch node %d to state %s\n",
+						 node->nodeid, dlm_state_str(node->state));
 				}
 				break;
 			case DLM_FIN_WAIT1:
-- 
2.31.1


  parent reply	other threads:[~2023-01-12 22:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-12 22:18 [Cluster-devel] [PATCH dlm/next 0/8] fs: dlm: better handling for new stop/start testcase Alexander Aring
2023-01-12 22:18 ` [Cluster-devel] [PATCH dlm/next 1/8] fs: dlm: bring back previously shutdown handling Alexander Aring
2023-01-12 22:18 ` [Cluster-devel] [PATCH dlm/next 2/8] fs: dlm: change to ignore unexpected non dlm opts msgs Alexander Aring
2023-01-12 22:18 ` [Cluster-devel] [PATCH dlm/next 3/8] fs: dlm: wait until all midcomms nodes detects version Alexander Aring
2023-01-12 22:18 ` [Cluster-devel] [PATCH dlm/next 4/8] fs: dlm: make dlm sequence id handling more robust Alexander Aring
2023-01-12 22:18 ` [Cluster-devel] [PATCH dlm/next 5/8] fs: dlm: reduce the timeout time to 5 secs Alexander Aring
2023-01-12 22:18 ` [Cluster-devel] [PATCH dlm/next 6/8] fs: dlm: remove newline in log_print Alexander Aring
2023-01-12 22:18 ` Alexander Aring [this message]
2023-01-12 22:18 ` [Cluster-devel] [PATCH dlm/next 8/8] fs: dlm: remove unnecessary waker_up() calls Alexander Aring

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=20230112221849.1883104-8-aahringo@redhat.com \
    --to=aahringo@redhat.com \
    /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).