summaryrefslogtreecommitdiff
path: root/fs/dlm
diff options
context:
space:
mode:
authorAlexander Aring <aahringo@redhat.com>2021-03-02 01:05:19 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-05-19 11:12:52 +0300
commita407b5881686a3c08902d54d958e28f7bad4070a (patch)
tree68350866852e0c0a9c47c1166e8fc260ba17408f /fs/dlm
parentff58d1c72edfc000b3a4ec9d5c963023ef869999 (diff)
downloadlinux-a407b5881686a3c08902d54d958e28f7bad4070a.tar.xz
fs: dlm: flush swork on shutdown
[ Upstream commit eec054b5a7cfe6d1f1598a323b05771ee99857b5 ] 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>
Diffstat (limited to 'fs/dlm')
-rw-r--r--fs/dlm/lowcomms.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c
index 79f56f16bc2c..44e2716ac158 100644
--- a/fs/dlm/lowcomms.c
+++ b/fs/dlm/lowcomms.c
@@ -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 */