Skip to content

Commit

Permalink
fs: dlm: synchronize dlm before shutdown
Browse files Browse the repository at this point in the history
This patch moves the dlm workqueue dlm synchronization before shutdown
handling. The patch just flushes all pending work before starting to
shutdown the connection. At least for the send_workqeue we should flush
the workqueue to make sure there is no new connection handling going on
as dlm_allow_conn switch is turned to false before.

Signed-off-by: Alexander Aring <[email protected]>
Signed-off-by: David Teigland <[email protected]>
  • Loading branch information
Alexander Aring authored and teigland committed Aug 27, 2020
1 parent d012a71 commit aa7ab1e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions fs/dlm/lowcomms.c
Original file line number Diff line number Diff line change
Expand Up @@ -1624,10 +1624,6 @@ static void work_flush(void)
struct hlist_node *n;
struct connection *con;

if (recv_workqueue)
flush_workqueue(recv_workqueue);
if (send_workqueue)
flush_workqueue(send_workqueue);
do {
ok = 1;
foreach_conn(stop_conn);
Expand Down Expand Up @@ -1659,6 +1655,12 @@ void dlm_lowcomms_stop(void)
mutex_lock(&connections_lock);
dlm_allow_conn = 0;
mutex_unlock(&connections_lock);

if (recv_workqueue)
flush_workqueue(recv_workqueue);
if (send_workqueue)
flush_workqueue(send_workqueue);

foreach_conn(shutdown_conn);
work_flush();
clean_writequeues();
Expand Down

0 comments on commit aa7ab1e

Please sign in to comment.