Skip to content

Commit

Permalink
fs: dlm: flush swork on shutdown
Browse files Browse the repository at this point in the history
[ Upstream commit eec054b ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Alexander Aring authored and gregkh committed May 19, 2021
1 parent ff58d1c commit a407b58
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions fs/dlm/lowcomms.c
Expand Up @@ -612,10 +612,7 @@ static void shutdown_connection(struct connection *con)
{
int ret;

if (cancel_work_sync(&con->swork)) {
log_print("canceled swork for node %d", con->nodeid);
clear_bit(CF_WRITE_PENDING, &con->flags);
}
flush_work(&con->swork);

mutex_lock(&con->sock_mutex);
/* nothing to shutdown */
Expand Down

0 comments on commit a407b58

Please sign in to comment.