aboutsummaryrefslogtreecommitdiffstats
path: root/fs/dlm
diff options
context:
space:
mode:
authorAlexander Aring <aahringo@redhat.com>2023-01-12 17:18:48 -0500
committerDavid Teigland <teigland@redhat.com>2023-01-23 16:27:27 -0600
commitef7ef015eb333c8954d7165d216ec0c774d7e4e4 (patch)
tree7a6dc304606db9c4c3dc7b3caf98445c298e993c /fs/dlm
parent3186409711e64ed0a0fa767fad555a5e655022da (diff)
downloadlinux-ef7ef015eb333c8954d7165d216ec0c774d7e4e4.tar.gz
fs: dlm: move state change into else branch
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> Signed-off-by: David Teigland <teigland@redhat.com>
Diffstat (limited to 'fs/dlm')
-rw-r--r--fs/dlm/midcomms.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/dlm/midcomms.c b/fs/dlm/midcomms.c
index 7827d049378ca..69e6f4705ebc4 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: