]> git.baikalelectronics.ru Git - kernel.git/commit
dlm: free workqueues after the connections
authorMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Sat, 8 Oct 2016 13:14:37 +0000 (10:14 -0300)
committerDavid Teigland <teigland@redhat.com>
Mon, 10 Oct 2016 14:54:00 +0000 (09:54 -0500)
commit73cc97aef44bc3f05e7c77d2088aac995d37f538
treee4395e493ec475bbcb9402e647e9429b56be3db3
parenta4f2277c6df45685f174bf2a0b30bc54b8d76390
dlm: free workqueues after the connections

After backporting commit 8f2b66d300d7 ("dlm: use sctp 1-to-1 API")
series to a kernel with an older workqueue which didn't use RCU yet, it
was noticed that we are freeing the workqueues in dlm_lowcomms_stop()
too early as free_conn() will try to access that memory for canceling
the queued works if any.

This issue was introduced by commit 139d34ff95e7 as before it such
attempt to cancel the queued works wasn't performed, so the issue was
not present.

This patch fixes it by simply inverting the free order.

Cc: stable@vger.kernel.org
Fixes: 139d34ff95e7 ("dlm: fix race while closing connections")
Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David Teigland <teigland@redhat.com>
fs/dlm/lowcomms.c