| From 1b9de08db8ec2701733d1519930b7fa8bac724fb Mon Sep 17 00:00:00 2001 |
| From: Jens Axboe <axboe@kernel.dk> |
| Date: Wed, 9 Oct 2019 14:40:13 -0600 |
| Subject: [PATCH] io_uring: only flush workqueues on fileset removal |
| |
| commit 8a99734081775c012a4a6c442fdef0379fe52bdf upstream. |
| |
| We should not remove the workqueue, we just need to ensure that the |
| workqueues are synced. The workqueues are torn down on ctx removal. |
| |
| Cc: stable@vger.kernel.org |
| Fixes: 6b06314c47e1 ("io_uring: add file set registration") |
| Reported-by: Stefan Hajnoczi <stefanha@redhat.com> |
| Signed-off-by: Jens Axboe <axboe@kernel.dk> |
| Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
| [PG: use 5.3.x-stable version for this v5.2.x codebase.] |
| Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> |
| |
| diff --git a/fs/io_uring.c b/fs/io_uring.c |
| index 701936f2bde3..1885ac649654 100644 |
| --- a/fs/io_uring.c |
| +++ b/fs/io_uring.c |
| @@ -2354,7 +2354,8 @@ static void io_destruct_skb(struct sk_buff *skb) |
| { |
| struct io_ring_ctx *ctx = skb->sk->sk_user_data; |
| |
| - io_finish_async(ctx); |
| + if (ctx->sqo_wq) |
| + flush_workqueue(ctx->sqo_wq); |
| unix_destruct_scm(skb); |
| } |
| |
| -- |
| 2.7.4 |
| |