[RESEND,4/4] fs/fuse kio_pcs: flush rpc work inside pcs_rpc_destroy()

Submitted by Kirill Tkhai on Oct. 17, 2018, 9:08 a.m.

Details

Message ID 153976729862.29624.7816433538165937544.stgit@localhost.localdomain
State New
Series "Order rpc destroy with rpc_queue_work()"
Headers show

Commit Message

Kirill Tkhai Oct. 17, 2018, 9:08 a.m.
From: Pavel Butsykin <pbutsykin@virtuozzo.com>

This flush is necessary to done pending messages and
to execute queued work before we free rpc memory.

Signed-off-by: Pavel Butsykin <pbutsykin@virtuozzo.com>
ktkhai: comment rewritten
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 fs/fuse/kio/pcs/pcs_rpc.c |    1 +
 1 file changed, 1 insertion(+)

Patch hide | download patch | download mbox

diff --git a/fs/fuse/kio/pcs/pcs_rpc.c b/fs/fuse/kio/pcs/pcs_rpc.c
index 0717eeb6e99f..f6b8aefe6884 100644
--- a/fs/fuse/kio/pcs/pcs_rpc.c
+++ b/fs/fuse/kio/pcs/pcs_rpc.c
@@ -312,6 +312,7 @@  static void pcs_rpc_destroy(struct pcs_rpc *ep)
 	BUG_ON(timer_pending(&ep->timer_work.timer));
 
 	cancel_delayed_work_sync(&ep->calendar_work);
+	flush_work(&ep->work);
 
 	/* pcs_free(ep->sun); */
 	/* ep->sun = NULL; */