All of lore.kernel.org
 help / color / mirror / Atom feed
* FAILED: patch "[PATCH] io_uring: only flush workqueues on fileset removal" failed to apply to 5.3-stable tree
@ 2019-10-16 16:04 gregkh
  2019-10-16 16:13 ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: gregkh @ 2019-10-16 16:04 UTC (permalink / raw)
  To: axboe, stefanha; +Cc: stable


The patch below does not apply to the 5.3-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 8a99734081775c012a4a6c442fdef0379fe52bdf 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

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>

diff --git a/fs/io_uring.c b/fs/io_uring.c
index ceb3497bdd2a..2c44648217bd 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -2866,8 +2866,12 @@ static void io_finish_async(struct io_ring_ctx *ctx)
 static void io_destruct_skb(struct sk_buff *skb)
 {
 	struct io_ring_ctx *ctx = skb->sk->sk_user_data;
+	int i;
+
+	for (i = 0; i < ARRAY_SIZE(ctx->sqo_wq); i++)
+		if (ctx->sqo_wq[i])
+			flush_workqueue(ctx->sqo_wq[i]);
 
-	io_finish_async(ctx);
 	unix_destruct_scm(skb);
 }
 


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: FAILED: patch "[PATCH] io_uring: only flush workqueues on fileset removal" failed to apply to 5.3-stable tree
  2019-10-16 16:04 FAILED: patch "[PATCH] io_uring: only flush workqueues on fileset removal" failed to apply to 5.3-stable tree gregkh
@ 2019-10-16 16:13 ` Greg KH
  2019-10-16 16:20   ` Jens Axboe
  0 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2019-10-16 16:13 UTC (permalink / raw)
  To: axboe, stefanha; +Cc: stable

On Wed, Oct 16, 2019 at 09:04:43AM -0700, gregkh@linuxfoundation.org wrote:
> 
> The patch below does not apply to the 5.3-stable tree.
> If someone wants it applied there, or to any other stable or longterm
> tree, then please email the backport, including the original git commit
> id to <stable@vger.kernel.org>.
> 
> thanks,
> 
> greg k-h
> 
> ------------------ original commit in Linus's tree ------------------
> 
> >From 8a99734081775c012a4a6c442fdef0379fe52bdf 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
> 
> 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>
> 
> diff --git a/fs/io_uring.c b/fs/io_uring.c
> index ceb3497bdd2a..2c44648217bd 100644
> --- a/fs/io_uring.c
> +++ b/fs/io_uring.c
> @@ -2866,8 +2866,12 @@ static void io_finish_async(struct io_ring_ctx *ctx)
>  static void io_destruct_skb(struct sk_buff *skb)
>  {
>  	struct io_ring_ctx *ctx = skb->sk->sk_user_data;
> +	int i;
> +
> +	for (i = 0; i < ARRAY_SIZE(ctx->sqo_wq); i++)
> +		if (ctx->sqo_wq[i])
> +			flush_workqueue(ctx->sqo_wq[i]);
>  
> -	io_finish_async(ctx);
>  	unix_destruct_scm(skb);
>  }
>  
> 

This fails to build as sqo_wq is a pointer in 5.3, not an arrary.
Backporting that array change feels "big" for 5.3, is that needed here,
or can this be fixed differently?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: FAILED: patch "[PATCH] io_uring: only flush workqueues on fileset removal" failed to apply to 5.3-stable tree
  2019-10-16 16:13 ` Greg KH
@ 2019-10-16 16:20   ` Jens Axboe
  2019-10-16 16:33     ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: Jens Axboe @ 2019-10-16 16:20 UTC (permalink / raw)
  To: Greg KH, stefanha; +Cc: stable

On 10/16/19 10:13 AM, Greg KH wrote:
> On Wed, Oct 16, 2019 at 09:04:43AM -0700, gregkh@linuxfoundation.org wrote:
>>
>> The patch below does not apply to the 5.3-stable tree.
>> If someone wants it applied there, or to any other stable or longterm
>> tree, then please email the backport, including the original git commit
>> id to <stable@vger.kernel.org>.
>>
>> thanks,
>>
>> greg k-h
>>
>> ------------------ original commit in Linus's tree ------------------
>>
>> >From 8a99734081775c012a4a6c442fdef0379fe52bdf 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
>>
>> 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>
>>
>> diff --git a/fs/io_uring.c b/fs/io_uring.c
>> index ceb3497bdd2a..2c44648217bd 100644
>> --- a/fs/io_uring.c
>> +++ b/fs/io_uring.c
>> @@ -2866,8 +2866,12 @@ static void io_finish_async(struct io_ring_ctx *ctx)
>>   static void io_destruct_skb(struct sk_buff *skb)
>>   {
>>   	struct io_ring_ctx *ctx = skb->sk->sk_user_data;
>> +	int i;
>> +
>> +	for (i = 0; i < ARRAY_SIZE(ctx->sqo_wq); i++)
>> +		if (ctx->sqo_wq[i])
>> +			flush_workqueue(ctx->sqo_wq[i]);
>>   
>> -	io_finish_async(ctx);
>>   	unix_destruct_scm(skb);
>>   }
>>   
>>
> 
> This fails to build as sqo_wq is a pointer in 5.3, not an arrary.
> Backporting that array change feels "big" for 5.3, is that needed here,
> or can this be fixed differently?

Yeah, we don't need to do that. It's just a pointer in 5.3, not an
array of pointers, so the below should be all we need for 5.3 (and
5.2/5.1).


diff --git a/fs/io_uring.c b/fs/io_uring.c
index cfb48bd088e1..e05f302cfb41 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -2564,7 +2564,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);
 }
 

-- 
Jens Axboe


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: FAILED: patch "[PATCH] io_uring: only flush workqueues on fileset removal" failed to apply to 5.3-stable tree
  2019-10-16 16:20   ` Jens Axboe
@ 2019-10-16 16:33     ` Greg KH
  2019-10-16 16:37       ` Jens Axboe
  0 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2019-10-16 16:33 UTC (permalink / raw)
  To: Jens Axboe; +Cc: stefanha, stable

On Wed, Oct 16, 2019 at 10:20:16AM -0600, Jens Axboe wrote:
> On 10/16/19 10:13 AM, Greg KH wrote:
> > On Wed, Oct 16, 2019 at 09:04:43AM -0700, gregkh@linuxfoundation.org wrote:
> >>
> >> The patch below does not apply to the 5.3-stable tree.
> >> If someone wants it applied there, or to any other stable or longterm
> >> tree, then please email the backport, including the original git commit
> >> id to <stable@vger.kernel.org>.
> >>
> >> thanks,
> >>
> >> greg k-h
> >>
> >> ------------------ original commit in Linus's tree ------------------
> >>
> >> >From 8a99734081775c012a4a6c442fdef0379fe52bdf 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
> >>
> >> 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>
> >>
> >> diff --git a/fs/io_uring.c b/fs/io_uring.c
> >> index ceb3497bdd2a..2c44648217bd 100644
> >> --- a/fs/io_uring.c
> >> +++ b/fs/io_uring.c
> >> @@ -2866,8 +2866,12 @@ static void io_finish_async(struct io_ring_ctx *ctx)
> >>   static void io_destruct_skb(struct sk_buff *skb)
> >>   {
> >>   	struct io_ring_ctx *ctx = skb->sk->sk_user_data;
> >> +	int i;
> >> +
> >> +	for (i = 0; i < ARRAY_SIZE(ctx->sqo_wq); i++)
> >> +		if (ctx->sqo_wq[i])
> >> +			flush_workqueue(ctx->sqo_wq[i]);
> >>   
> >> -	io_finish_async(ctx);
> >>   	unix_destruct_scm(skb);
> >>   }
> >>   
> >>
> > 
> > This fails to build as sqo_wq is a pointer in 5.3, not an arrary.
> > Backporting that array change feels "big" for 5.3, is that needed here,
> > or can this be fixed differently?
> 
> Yeah, we don't need to do that. It's just a pointer in 5.3, not an
> array of pointers, so the below should be all we need for 5.3 (and
> 5.2/5.1).

5.2/5.1 are long end-of-life, but this change looks sane.  I'll go queue
it up for 5.3.y, thanks for the patch!

greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: FAILED: patch "[PATCH] io_uring: only flush workqueues on fileset removal" failed to apply to 5.3-stable tree
  2019-10-16 16:33     ` Greg KH
@ 2019-10-16 16:37       ` Jens Axboe
  0 siblings, 0 replies; 5+ messages in thread
From: Jens Axboe @ 2019-10-16 16:37 UTC (permalink / raw)
  To: Greg KH; +Cc: stefanha, stable

On 10/16/19 10:33 AM, Greg KH wrote:
> On Wed, Oct 16, 2019 at 10:20:16AM -0600, Jens Axboe wrote:
>> On 10/16/19 10:13 AM, Greg KH wrote:
>>> On Wed, Oct 16, 2019 at 09:04:43AM -0700, gregkh@linuxfoundation.org wrote:
>>>>
>>>> The patch below does not apply to the 5.3-stable tree.
>>>> If someone wants it applied there, or to any other stable or longterm
>>>> tree, then please email the backport, including the original git commit
>>>> id to <stable@vger.kernel.org>.
>>>>
>>>> thanks,
>>>>
>>>> greg k-h
>>>>
>>>> ------------------ original commit in Linus's tree ------------------
>>>>
>>>> >From 8a99734081775c012a4a6c442fdef0379fe52bdf 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
>>>>
>>>> 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>
>>>>
>>>> diff --git a/fs/io_uring.c b/fs/io_uring.c
>>>> index ceb3497bdd2a..2c44648217bd 100644
>>>> --- a/fs/io_uring.c
>>>> +++ b/fs/io_uring.c
>>>> @@ -2866,8 +2866,12 @@ static void io_finish_async(struct io_ring_ctx *ctx)
>>>>    static void io_destruct_skb(struct sk_buff *skb)
>>>>    {
>>>>    	struct io_ring_ctx *ctx = skb->sk->sk_user_data;
>>>> +	int i;
>>>> +
>>>> +	for (i = 0; i < ARRAY_SIZE(ctx->sqo_wq); i++)
>>>> +		if (ctx->sqo_wq[i])
>>>> +			flush_workqueue(ctx->sqo_wq[i]);
>>>>    
>>>> -	io_finish_async(ctx);
>>>>    	unix_destruct_scm(skb);
>>>>    }
>>>>    
>>>>
>>>
>>> This fails to build as sqo_wq is a pointer in 5.3, not an arrary.
>>> Backporting that array change feels "big" for 5.3, is that needed here,
>>> or can this be fixed differently?
>>
>> Yeah, we don't need to do that. It's just a pointer in 5.3, not an
>> array of pointers, so the below should be all we need for 5.3 (and
>> 5.2/5.1).
> 
> 5.2/5.1 are long end-of-life, but this change looks sane.  I'll go queue
> it up for 5.3.y, thanks for the patch!

Thanks Greg!

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-10-16 16:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-16 16:04 FAILED: patch "[PATCH] io_uring: only flush workqueues on fileset removal" failed to apply to 5.3-stable tree gregkh
2019-10-16 16:13 ` Greg KH
2019-10-16 16:20   ` Jens Axboe
2019-10-16 16:33     ` Greg KH
2019-10-16 16:37       ` Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.