fs: dlm: flush swork on shutdown

This patch fixes the flushing of send work before shutdown. The function
cancel_work_sync() is not the right workqueue functionality to use here
as it would cancel the work if the work queues itself. In cases of
EAGAIN in send() for dlm message we need to be sure that everything is
send out before. The function flush_work() will ensure that every send
work is be done inclusive in EAGAIN cases.

Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
This commit is contained in:
Alexander Aring 2021-03-01 17:05:19 -05:00 committed by David Teigland
parent df9e06b800
commit eec054b5a7

View File

@ -712,10 +712,7 @@ static void shutdown_connection(struct connection *con)
{ {
int ret; int ret;
if (cancel_work_sync(&con->swork)) { flush_work(&con->swork);
log_print("canceled swork for node %d", con->nodeid);
clear_bit(CF_WRITE_PENDING, &con->flags);
}
mutex_lock(&con->sock_mutex); mutex_lock(&con->sock_mutex);
/* nothing to shutdown */ /* nothing to shutdown */