mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 02:00:54 +07:00
dlm: check if workqueues are NULL before flushing/destroying
If the DLM lowcomms stack is shut down before any DLM traffic can be generated, flush_workqueue() and destroy_workqueue() can be called on empty send and/or recv workqueues. Insert guard conditionals to only call flush_workqueue() and destroy_workqueue() on workqueues that are not NULL. Signed-off-by: David Windsor <dwindsor@redhat.com> Signed-off-by: David Teigland <teigland@redhat.com>
This commit is contained in:
parent
d1fdb6d8f6
commit
b355516f45
@ -1628,8 +1628,10 @@ static void clean_writequeues(void)
|
||||
|
||||
static void work_stop(void)
|
||||
{
|
||||
destroy_workqueue(recv_workqueue);
|
||||
destroy_workqueue(send_workqueue);
|
||||
if (recv_workqueue)
|
||||
destroy_workqueue(recv_workqueue);
|
||||
if (send_workqueue)
|
||||
destroy_workqueue(send_workqueue);
|
||||
}
|
||||
|
||||
static int work_start(void)
|
||||
@ -1689,13 +1691,17 @@ static void work_flush(void)
|
||||
struct hlist_node *n;
|
||||
struct connection *con;
|
||||
|
||||
flush_workqueue(recv_workqueue);
|
||||
flush_workqueue(send_workqueue);
|
||||
if (recv_workqueue)
|
||||
flush_workqueue(recv_workqueue);
|
||||
if (send_workqueue)
|
||||
flush_workqueue(send_workqueue);
|
||||
do {
|
||||
ok = 1;
|
||||
foreach_conn(stop_conn);
|
||||
flush_workqueue(recv_workqueue);
|
||||
flush_workqueue(send_workqueue);
|
||||
if (recv_workqueue)
|
||||
flush_workqueue(recv_workqueue);
|
||||
if (send_workqueue)
|
||||
flush_workqueue(send_workqueue);
|
||||
for (i = 0; i < CONN_HASH_SIZE && ok; i++) {
|
||||
hlist_for_each_entry_safe(con, n,
|
||||
&connection_hash[i], list) {
|
||||
|
Loading…
Reference in New Issue
Block a user