fs: dlm: flush swork on shutdown
authorAlexander Aring <aahringo@redhat.com>
Mon, 1 Mar 2021 22:05:19 +0000 (17:05 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 May 2021 08:12:52 +0000 (10:12 +0200)
commita407b5881686a3c08902d54d958e28f7bad4070a
tree68350866852e0c0a9c47c1166e8fc260ba17408f
parentff58d1c72edfc000b3a4ec9d5c963023ef869999
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>
fs/dlm/lowcomms.c